Part Number Hot Search : 
28000 1210220 EC6A04 1N4728 RG4BC30 500MA KIA6240K XN7651
Product Description
Full Text Search
 

To Download SH7050F-ZTAT Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  revision date: jan 06 , 2006 32 sh7050 group, SH7050F-ZTAT?, sh7051f-ztat? hardware manual renesas 32-bit risc microcomputer superh ? risc engine family/sh7050 series hd6437050 hd64f7050 hd64f7051 rev. 5.00 rej09b0273-0500
rev. 5.00 jan 06, 2006 page ii of xx 1. these materials are intended as a reference to assist our customers in the selection of the renesas technology corp. product best suited to the customer's application; they do not convey any license under any intellectual property rights, or any other rights, belonging to renesas technology corp. or a third party. 2. renesas technology corp. assumes no responsibility for any damage, or infringement of any third- party's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained in these materials. 3. all information contained in these materials, including product data, diagrams, charts, programs and algorithms represents information on products at the time of publication of these materials, and are subject to change by renesas technology corp. without notice due to product improvements or other reasons. it is therefore recommended that customers contact renesas technology corp. or an authorized renesas technology corp. product distributor for the latest product information before purchasing a product listed herein. the information described here may contain technical inaccuracies or typographical errors. renesas technology corp. assumes no responsibility for any damage, liability, or other loss rising from these inaccuracies or errors. please also pay attention to information published by renesas technology corp. by various means, including the renesas technology corp. semiconductor home page (http://www.renesas.com). 4. when using any or all of the information contained in these materials, including product data, diagrams, charts, programs, and algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products. renesas technology corp. assumes no responsibility for any damage, liability or other loss resulting from the information contained herein. 5. renesas technology corp. semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. please contact renesas technology corp. or an authorized renesas technology corp. product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use. 6. the prior written approval of renesas technology corp. is necessary to reprint or reproduce in whole or in part these materials. 7. if these products or technologies are subject to the japanese export control restrictions, they must be exported under a license from the japanese government and cannot be imported into a country other than the approved destination. any diversion or reexport contrary to the export control laws and regulations of japan and/or the country of destination is prohibited. 8. please contact renesas technology corp. for further details on these materials or the products contained therein. 1. renesas technology corp. puts the maximum effort into making semiconductor products better and more reliable, but there is always the possibility that trouble may occur with them. trouble with semiconductors may lead to personal injury, fire or property damage. remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or (iii) prevention against any malfunction or mishap. keep safety first in your circuit designs! notes regarding these materials
rev. 5.00 jan 06, 2006 page iii of xx preface the sh7050 series (sh7050, sh7051) is a single-chip risc microcontroller that integrates a risc cpu core using an original renesas architecture with peripheral functions required for system configuration. the cpu has a risc-type instruction set. most instructions can be executed in one state (one system clock cycle), which greatly improves instruction execution speed. in addition, the 32-bit internal architecture enhances data processing power. with this cpu, it has become possible to assemble low-cost, high-performance/high-functionality systems even for applications such as real-time control, which could not previously be handled by microcontrollers because of their high-speed processing requirements. in addition, the sh7050 series includes on-chip peripheral functions necessary for synchronous configuration, such as large-capacity rom and ram, a direct memory access controller (dmac), timers, a serial communication interface (sci), a/d converter, interrupt controller (intc), and i/o ports. rom and sram can be directly connected by means of an external memory access support function, greatly reducing system cost. there are versions of on-chip rom: mask rom and flash memory. the flash memory can be programmed with a programmer that supports sh7050 series programming, and can also be programmed and erased by software. this hardware manual describes the sh7050 series hardware. refer to the programming manual for a detailed description of the instruction set. related manual sh7050 series instructions sh-1/sh-2/sh-dsp software manual (document no. rej09b0171-0500o) please consult your renesas sales representative for details of development environment system.
rev. 5.00 jan 06, 2006 page iv of xx
rev. 5.00 jan 06, 2006 page v of xx main revisions for this edition item page revision (see manual for details) all ? all references to hitachi, hitachi, ltd., hitachi semiconductors, and other hitachi brand names changed to renesas technology corp. changes due to change in package codes. fp-168b prqp0168ja-a 2.3.3 instruction format table 2.9 instruction formats 35 table amended instruction formats source operand destination operand d format dddd xxxx 15 0 xxxx dddd ? dddddddd : pc relative d12 format dddd xxxx 15 0 dddd dddd ? dddddddddddd : pc relative 13.2.8 bit rate register (brr) 385 description amended n = 8 ? ? item pin symbol min typ max unit reference power supply current during a/d conversion ai ref ? 1.0 5 ma table 22.3 permitted output current values 656 table amended item symbol min typ max unit output low-level permissible current (per pin) i ol ?? 8.0 ma note: to assure lsi reliability, do not exceed the output values listed in this table.
rev. 5.00 jan 06, 2006 page vi of xx
rev. 5.00 jan 06, 2006 page vii of xx contents section 1 overview ............................................................................................................. 1 1.1 features .................................................................................................................... ......... 1 1.2 block diagram ............................................................................................................... ... 7 1.3 pin arrangement and pin functions ................................................................................. 8 1.3.1 pin arrangement .................................................................................................. 8 1.3.2 pin functions ....................................................................................................... 9 1.3.3 pin assignments................................................................................................... 15 section 2 cpu ...................................................................................................................... 21 2.1 register configuration...................................................................................................... 21 2.1.1 general registers (rn)......................................................................................... 21 2.1.2 control registers ................................................................................................. 22 2.1.3 system registers.................................................................................................. 23 2.1.4 initial values of registers.................................................................................... 23 2.2 data formats................................................................................................................ ..... 24 2.2.1 data format in registers...................................................................................... 24 2.2.2 data format in memory....................................................................................... 24 2.2.3 immediate data format ....................................................................................... 25 2.3 instruction features........................................................................................................ ... 25 2.3.1 risc-type instruction set................................................................................... 25 2.3.2 addressing modes ............................................................................................... 29 2.3.3 instruction format................................................................................................ 33 2.4 instruction set by classification ....................................................................................... 36 2.5 processing states........................................................................................................... .... 48 2.5.1 state transitions................................................................................................... 48 section 3 operating modes ............................................................................................... 51 3.1 operating mode selection ................................................................................................ 51 section 4 clock pulse generator (cpg) ....................................................................... 53 4.1 overview.................................................................................................................... ....... 53 4.1.1 block diagram..................................................................................................... 54 4.1.2 pin configuration................................................................................................. 55 4.2 clock operating modes .................................................................................................... 55 4.3 clock source................................................................................................................ ..... 56 4.3.1 connecting a crystal oscillator ........................................................................... 56 4.3.2 external clock input method............................................................................... 57
rev. 5.00 jan 06, 2006 page viii of xx 4.4 notes on using.............................................................................................................. .... 58 section 5 exception processing ....................................................................................... 61 5.1 overview.................................................................................................................... ....... 61 5.1.1 types of exception processing and priority ........................................................ 61 5.1.2 exception processing operations......................................................................... 62 5.1.3 exception processing vector table ..................................................................... 63 5.2 resets ...................................................................................................................... .......... 65 5.2.1 power-on reset ................................................................................................... 65 5.3 address errors .............................................................................................................. .... 66 5.3.1 address error sources ......................................................................................... 66 5.3.2 address error exception processing.................................................................... 67 5.4 interrupts .................................................................................................................. ......... 67 5.4.1 interrupt sources.................................................................................................. 67 5.4.2 interrupt priority level ........................................................................................ 68 5.4.3 interrupt exception processing ............................................................................ 68 5.5 exceptions triggered by instructions ............................................................................... 69 5.5.1 types of exceptions triggered by instructions ................................................... 69 5.5.2 trap instructions .................................................................................................. 69 5.5.3 illegal slot instructions ........................................................................................ 70 5.5.4 general illegal instructions.................................................................................. 70 5.6 when exception sources are not accepted .................................................................... 71 5.6.1 immediately after a delayed branch instruction ................................................. 71 5.6.2 immediately after an interrupt-disabled instruction............................................ 71 5.7 stack status after exception processing ends .................................................................. 72 5.8 notes on use ................................................................................................................ ..... 73 5.8.1 value of stack pointer (sp) ................................................................................. 73 5.8.2 value of vector base register (vbr) ................................................................. 73 5.8.3 address errors caused by stacking of address error exception processing...... 73 section 6 interrupt controller (intc) ........................................................................... 75 6.1 overview.................................................................................................................... ....... 75 6.1.1 features................................................................................................................ 75 6.1.2 block diagram..................................................................................................... 76 6.1.3 pin configuration................................................................................................. 77 6.1.4 register configuration......................................................................................... 77 6.2 interrupt sources........................................................................................................... .... 78 6.2.1 nmi interrupts ..................................................................................................... 78 6.2.2 user break interrupt ............................................................................................ 78 6.2.3 irq interrupts ...................................................................................................... 78 6.2.4 on-chip peripheral module interrupts ................................................................ 79
rev. 5.00 jan 06, 2006 page ix of xx 6.2.5 interrupt exception vectors and priority rankings ............................................. 79 6.3 description of registers.................................................................................................... 84 6.3.1 interrupt priority registers a?h (ipra?iprh) .................................................. 84 6.3.2 interrupt control register (icr).......................................................................... 86 6.3.3 irq status register (isr).................................................................................... 87 6.4 interrupt operation......................................................................................................... ... 89 6.4.1 interrupt sequence ............................................................................................... 89 6.4.2 stack after interrupt exception processing .......................................................... 91 6.5 interrupt response time................................................................................................... 92 6.6 data transfer with interrupt request signals ................................................................... 93 6.6.1 handling cpu interrupt sources, but not dmac activating sources ............... 94 6.6.2 handling dmac activating sources but not cpu interrupt sources ................ 94 section 7 user break controller (ubc) ....................................................................... 95 7.1 overview.................................................................................................................... ....... 95 7.1.1 features................................................................................................................ 95 7.1.2 block diagram..................................................................................................... 96 7.1.3 register configuration......................................................................................... 97 7.2 register descriptions ....................................................................................................... .97 7.2.1 user break address register (ubar) ................................................................ 97 7.2.2 user break address mask register (ubamr) ................................................... 98 7.2.3 user break bus cycle register (ubbr) ............................................................. 100 7.3 operation ................................................................................................................... ....... 102 7.3.1 flow of the user break operation ....................................................................... 102 7.3.2 break on on-chip memory instruction fetch cycle ........................................... 104 7.3.3 program counter (pc) values saved................................................................... 104 7.4 use examples................................................................................................................ .... 105 7.4.1 break on cpu instruction fetch cycle................................................................ 105 7.4.2 break on cpu data access cycle ....................................................................... 106 7.4.3 break on dma/dtc cycle ................................................................................. 106 7.5 cautions on use ............................................................................................................. ... 107 7.5.1 on-chip memory instruction fetch..................................................................... 107 7.5.2 instruction fetch at branches............................................................................... 107 7.5.3 contention between user break and exception handling................................... 108 7.5.4 break at non-delay branch instruction jump destination.................................. 108 section 8 bus state controller (bsc) ........................................................................... 109 8.1 overview.................................................................................................................... ....... 109 8.1.1 features................................................................................................................ 10 9 8.1.2 block diagram..................................................................................................... 110 8.1.3 pin configuration................................................................................................. 111
rev. 5.00 jan 06, 2006 page x of xx 8.1.4 register configuration......................................................................................... 111 8.1.5 address map ........................................................................................................ 112 8.2 description of registers.................................................................................................... 115 8.2.1 bus control register 1 (bcr1) ........................................................................... 115 8.2.2 bus control register 2 (bcr2) ........................................................................... 116 8.2.3 wait control register 1 (wcr1)......................................................................... 119 8.2.4 wait control register 2 (wcr2)......................................................................... 121 8.2.5 ram emulation register (ramer)................................................................... 122 8.3 accessing ordinary space ................................................................................................ 124 8.3.1 basic timing........................................................................................................ 124 8.3.2 wait state control................................................................................................ 125 8.3.3 cs assert period extension ................................................................................. 127 8.4 waits between access cycles ........................................................................................... 128 8.4.1 prevention of data bus conflicts......................................................................... 128 8.4.2 simplification of bus cycle start detection ........................................................ 130 8.5 bus arbitration............................................................................................................. ..... 131 8.6 memory connection examples......................................................................................... 132 section 9 direct memory access controller (dmac) ............................................ 135 9.1 overview.................................................................................................................... ....... 135 9.1.1 features................................................................................................................ 13 5 9.1.2 block diagram..................................................................................................... 137 9.1.3 pin configuration................................................................................................. 138 9.1.4 register configuration......................................................................................... 138 9.2 register descriptions ....................................................................................................... . 140 9.2.1 dma source address registers 0?3 (sar0?sar3) .......................................... 140 9.2.2 dma destination address registers 0?3 (dar0?dar3).................................. 141 9.2.3 dma transfer count registers 0?3 (dmatcr0?dmatcr3)......................... 142 9.2.4 dma channel control registers 0?3 (chcr0?chcr3)................................... 143 9.2.5 dmac operation register (dmaor) ................................................................ 148 9.3 operation ................................................................................................................... ....... 150 9.3.1 dma transfer flow ............................................................................................ 150 9.3.2 dma transfer requests ...................................................................................... 152 9.3.3 channel priority................................................................................................... 155 9.3.4 dma transfer types........................................................................................... 158 9.3.5 address modes .................................................................................................... 159 9.3.6 dual address mode ............................................................................................. 160 9.3.7 bus modes ........................................................................................................... 167 9.3.8 relationship between request modes and bus modes by dma transfer category............................................................................................................... 168 9.3.9 bus mode and channel priority order................................................................. 169
rev. 5.00 jan 06, 2006 page xi of xx 9.3.10 number of bus cycle states and dreq pin sample timing.............................. 169 9.3.11 source address reload function......................................................................... 186 9.3.12 dma transfer ending conditions....................................................................... 188 9.3.13 dmac access from cpu.................................................................................... 189 9.4 examples of use ............................................................................................................. .. 189 9.4.1 example of dma transfer between on-chip sci and external memory .......... 189 9.4.2 example of dma transfer between external ram and external device with dack .......................................................................................................... 190 9.4.3 example of dma transfer between a/d converter and internal memory (address reload on)............................................................................................ 190 9.4.4 example of dma transfer between external memory and sci1 send side (indirect address on) .......................................................................................... 192 9.5 cautions on use ............................................................................................................. ... 194 section 10 advanced timer unit (atu) ..................................................................... 195 10.1 overview................................................................................................................... ........ 195 10.1.1 features................................................................................................................ 1 95 10.1.2 block diagrams ................................................................................................... 200 10.1.3 inter-channel and inter-module signal connection diagram ............................. 208 10.1.4 prescaler diagram................................................................................................ 209 10.1.5 pin configuration................................................................................................. 210 10.1.6 register and counter configuration .................................................................... 212 10.2 register descriptions ...................................................................................................... .. 216 10.2.1 timer start register (tstr)................................................................................ 216 10.2.2 timer mode register (tmdr) ............................................................................ 218 10.2.3 prescaler register 1 (pscr1) .............................................................................. 220 10.2.4 timer control registers (tcr) ........................................................................... 221 10.2.5 timer i/o control registers (tior).................................................................... 225 10.2.6 trigger selection register (tgsr)...................................................................... 233 10.2.7 timer status registers (tsr) .............................................................................. 235 10.2.8 timer interrupt enable registers (tier) ............................................................ 252 10.2.9 interval interrupt request register (itvrr)....................................................... 264 10.2.10 down-count start register (dstr) .................................................................... 267 10.2.11 timer connection register (tcnr).................................................................... 271 10.2.12 free-running counters (tcnt).......................................................................... 274 10.2.13 input capture registers (icr) ............................................................................. 276 10.2.14 general registers (gr)........................................................................................ 277 10.2.15 down-counters (dcnt) ..................................................................................... 278 10.2.16 offset base register (osbr) .............................................................................. 279 10.2.17 cycle registers (cylr) ...................................................................................... 280 10.2.18 buffer registers (bfr) ........................................................................................ 281
rev. 5.00 jan 06, 2006 page xii of xx 10.2.19 duty registers (dtr) .......................................................................................... 282 10.3 operation .................................................................................................................. ........ 283 10.3.1 overview.............................................................................................................. 283 10.3.2 free-running count operation and cyclic count operation .............................. 285 10.3.3 output compare-match function ........................................................................ 286 10.3.4 input capture function ........................................................................................ 288 10.3.5 one-shot pulse function ..................................................................................... 289 10.3.6 offset one-shot pulse function .......................................................................... 290 10.3.7 interval timer operation ..................................................................................... 292 10.3.8 twin-capture function........................................................................................ 294 10.3.9 pwm timer function .......................................................................................... 295 10.3.10 buffer function.................................................................................................... 297 10.3.11 one-shot pulse function pulse output timing ................................................... 298 10.3.12 offset one-shot pulse function pulse output timing ........................................ 299 10.3.13 channel 3 to 5 pwm output waveform actual cycle and actual duty ............ 300 10.3.14 channel 3 to 5 pwm output waveform settings and interrupt handling times ................................................................................................................... 301 10.3.15 pwm output operation at start of channel 3 to 5 counter ................................ 303 10.3.16 pwm output operation at start of channel 6 to 9 counter ................................ 304 10.3.17 timing of buffer register (bfr) write and transfer by buffer function .......... 305 10.4 interrupts ................................................................................................................. .......... 306 10.4.1 status flag setting timing................................................................................... 306 10.4.2 interrupt status flag clearing .............................................................................. 311 10.5 cpu interface.............................................................................................................. ...... 313 10.5.1 registers requiring 32-bit access ...................................................................... 313 10.5.2 registers requiring 16-bit access ...................................................................... 314 10.5.3 8-bit or 16-bit accessible registers.................................................................... 315 10.5.4 registers requiring 8-bit access ........................................................................ 316 10.6 sample setup procedures.................................................................................................. 31 6 10.7 usage notes ................................................................................................................ ...... 329 10.8 advanced timer unit registers and pins ........................................................................ 343 section 11 advanced pulse controller (apc) ............................................................ 345 11.1 overview................................................................................................................... ........ 345 11.1.1 features................................................................................................................ 3 45 11.1.2 block diagram..................................................................................................... 346 11.1.3 pin configuration................................................................................................. 347 11.1.4 register configuration......................................................................................... 347 11.2 register descriptions ...................................................................................................... .. 348 11.2.1 pulse output port control register (popcr)...................................................... 348 11.3 operation .................................................................................................................. ........ 349
rev. 5.00 jan 06, 2006 page xiii of xx 11.3.1 overview.............................................................................................................. 349 11.3.2 advanced pulse controller output operation ..................................................... 350 11.4 usage notes ................................................................................................................ ...... 353 section 12 watchdog timer (wdt) .............................................................................. 355 12.1 overview................................................................................................................... ........ 355 12.1.1 features................................................................................................................ 3 55 12.1.2 block diagram..................................................................................................... 356 12.1.3 pin configuration................................................................................................. 356 12.1.4 register configuration......................................................................................... 357 12.2 register descriptions ...................................................................................................... .. 357 12.2.1 timer counter (tcnt)........................................................................................ 357 12.2.2 timer control/status register (tcsr)................................................................ 358 12.2.3 reset control/status register (rstcsr) ............................................................ 360 12.2.4 register access.................................................................................................... 361 12.3 operation .................................................................................................................. ........ 362 12.3.1 watchdog timer mode ........................................................................................ 362 12.3.2 interval timer mode ............................................................................................ 364 12.3.3 clearing the standby mode ................................................................................. 364 12.3.4 timing of setting the overflow flag (ovf) ....................................................... 365 12.3.5 timing of setting the watchdog timer overflow flag (wovf)........................ 365 12.4 notes on use ............................................................................................................... ...... 366 12.4.1 tcnt write and increment contention .............................................................. 366 12.4.2 changing cks2 to cks0 bit values................................................................... 366 12.4.3 changing between watchdog timer/interval timer modes................................ 366 12.4.4 system reset with wdtovf ............................................................................. 367 12.4.5 internal reset with the watchdog timer ............................................................ 367 section 13 serial communication interface (sci) .................................................... 369 13.1 overview................................................................................................................... ........ 369 13.1.1 features................................................................................................................ 3 69 13.1.2 block diagram..................................................................................................... 370 13.1.3 pin configuration................................................................................................. 371 13.1.4 register configuration......................................................................................... 371 13.2 register descriptions ...................................................................................................... .. 373 13.2.1 receive shift register (rsr) .............................................................................. 373 13.2.2 receive data register (rdr) .............................................................................. 373 13.2.3 transmit shift register (tsr) ............................................................................. 374 13.2.4 transmit data register (tdr)............................................................................ 374 13.2.5 serial mode register (smr)................................................................................ 375 13.2.6 serial control register (scr).............................................................................. 377
rev. 5.00 jan 06, 2006 page xiv of xx 13.2.7 serial status register (ssr) ................................................................................ 380 13.2.8 bit rate register (brr) ...................................................................................... 384 13.3 operation .................................................................................................................. ........ 394 13.3.1 overview.............................................................................................................. 394 13.3.2 operation in asynchronous mode ....................................................................... 396 13.3.3 multiprocessor communication........................................................................... 406 13.3.4 clock synchronous operation ............................................................................. 414 13.4 sci interrupt sources and the dmac .............................................................................. 425 13.5 notes on use ............................................................................................................... ...... 426 13.5.1 tdr write and tdre flags................................................................................ 426 13.5.2 simultaneous multiple receive errors ................................................................ 426 13.5.3 break detection and processing .......................................................................... 427 13.5.4 sending a break signal........................................................................................ 427 13.5.5 receive error flags and transmitter operation (clock synchronous mode only) ........................................................................ 427 13.5.6 receive data sampling timing and receive margin in the asynchronous mode .................................................................................................................... 427 13.5.7 constraints on dmac use .................................................................................. 429 13.5.8 cautions for clock synchronous external clock mode ...................................... 429 13.5.9 caution for clock synchronous internal clock mode......................................... 429 section 14 a/d converter ................................................................................................. 431 14.1 overview................................................................................................................... ........ 431 14.1.1 features................................................................................................................ 4 31 14.1.2 block diagram..................................................................................................... 432 14.1.3 pin configuration................................................................................................. 434 14.1.4 register configuration......................................................................................... 436 14.2 register descriptions ...................................................................................................... .. 437 14.2.1 a/d data registers 0 to 15 (addr0 to addr15) ............................................. 437 14.2.2 a/d control/status register 0 (adcsr0)........................................................... 438 14.2.3 a/d control register 0 (adcr0)........................................................................ 442 14.2.4 a/d control/status register 1 (adcsr1)........................................................... 444 14.2.5 a/d control register 1 (adcr1)........................................................................ 445 14.2.6 a/d trigger register (adtrgr) ....................................................................... 446 14.3 cpu interface.............................................................................................................. ...... 447 14.4 operation .................................................................................................................. ........ 448 14.4.1 single mode......................................................................................................... 448 14.4.2 scan mode ........................................................................................................... 450 14.4.3 analog input setting and a/d conversion time................................................. 452 14.4.4 external triggering of a/d conversion .............................................................. 454 14.4.5 a/d converter activation by atu...................................................................... 455
rev. 5.00 jan 06, 2006 page xv of xx 14.4.6 adend output pin ............................................................................................. 455 14.5 interrupt sources and dma transfer requests ................................................................ 456 14.6 usage notes ................................................................................................................ ...... 456 section 15 compare match timer (cmt) ................................................................... 459 15.1 overview................................................................................................................... ........ 459 15.1.1 features................................................................................................................ 4 59 15.1.2 block diagram..................................................................................................... 460 15.1.3 register configuration......................................................................................... 461 15.2 register descriptions ...................................................................................................... .. 462 15.2.1 compare match timer start register (cmstr) ................................................. 462 15.2.2 compare match timer control/status register (cmcsr) ................................. 463 15.2.3 compare match timer counter (cmcnt) ......................................................... 464 15.2.4 compare match timer constant register (cmcor).......................................... 465 15.3 operation .................................................................................................................. ........ 465 15.3.1 period count operation ....................................................................................... 465 15.3.2 cmcnt count timing........................................................................................ 466 15.4 interrupts ................................................................................................................. .......... 466 15.4.1 interrupt sources and dtc activation ................................................................ 466 15.4.2 compare match flag set timing......................................................................... 467 15.4.3 compare match flag clear timing ..................................................................... 468 15.5 notes on use ............................................................................................................... ...... 469 15.5.1 contention between cmcnt write and compare match................................... 469 15.5.2 contention between cmcnt word write and incrementation .......................... 470 15.5.3 contention between cmcnt byte write and incrementation ............................ 471 section 16 pin function controller (pfc) ................................................................... 473 16.1 overview................................................................................................................... ........ 473 16.2 register configuration..................................................................................................... . 478 16.3 register descriptions ...................................................................................................... .. 479 16.3.1 port a io register (paior)................................................................................ 479 16.3.2 port a control register (pacr).......................................................................... 479 16.3.3 port b io register (pbior) ................................................................................ 484 16.3.4 port b control register (pbcr) .......................................................................... 484 16.3.5 port c io register (pcior) ................................................................................ 488 16.3.6 port c control registers 1 and 2 (pccr1, pccr2)............................................ 488 16.3.7 port d io register (pdior)................................................................................ 494 16.3.8 port d control register (pdcr).......................................................................... 494 16.3.9 port e io register (peior)................................................................................. 500 16.3.10 port e control register (pecr) .......................................................................... 500 16.3.11 port f io register (pfior) ................................................................................. 504
rev. 5.00 jan 06, 2006 page xvi of xx 16.3.12 port f control registers 1 and 2 (pfcr1, pfcr2) ............................................. 504 16.3.13 port g io register (pgior)................................................................................ 510 16.3.14 port g control registers 1 and 2 (pgcr1, pgcr2) ........................................... 510 16.3.15 ck control register (ckcr) .............................................................................. 516 section 17 i/o ports (i/o) ................................................................................................. 517 17.1 overview................................................................................................................... ........ 517 17.2 port a..................................................................................................................... ........... 517 17.2.1 register configuration......................................................................................... 518 17.2.2 port a data register (padr).............................................................................. 518 17.3 port b ..................................................................................................................... ........... 519 17.3.1 register configuration......................................................................................... 520 17.3.2 port b data register (pbdr) .............................................................................. 520 17.4 port c ..................................................................................................................... ........... 522 17.4.1 register configuration......................................................................................... 522 17.4.2 port c data register (pcdr) .............................................................................. 523 17.5 port d..................................................................................................................... ........... 524 17.5.1 register configuration......................................................................................... 525 17.5.2 port d data register (pddr).............................................................................. 525 17.6 port e ..................................................................................................................... ........... 527 17.6.1 register configuration......................................................................................... 527 17.6.2 port e data register (pedr)............................................................................... 528 17.7 port f..................................................................................................................... ............ 529 17.7.1 register configuration......................................................................................... 529 17.7.2 port f data register (pfdr) ............................................................................... 530 17.8 port g..................................................................................................................... ........... 531 17.8.1 register configuration......................................................................................... 531 17.8.2 port g data register (pgdr).............................................................................. 532 17.9 port h..................................................................................................................... ........... 533 17.9.1 register configuration......................................................................................... 533 17.9.2 port h data register (phdr).............................................................................. 534 17.10 pod (port output disable) ............................................................................................... 53 4 section 18 rom (128 kb version) ................................................................................ 535 18.1 features ................................................................................................................... .......... 535 18.2 overview................................................................................................................... ........ 536 18.2.1 block diagram..................................................................................................... 536 18.2.2 mode transitions ................................................................................................. 537 18.2.3 on-board programming modes........................................................................... 538 18.2.4 flash memory emulation in ram ...................................................................... 540 18.2.5 differences between boot mode and user program mode ................................. 541
rev. 5.00 jan 06, 2006 page xvii of xx 18.2.6 block configuration ............................................................................................ 542 18.3 pin configuration.......................................................................................................... .... 542 18.4 register configuration..................................................................................................... . 543 18.5 register descriptions ...................................................................................................... .. 544 18.5.1 flash memory control register 1 (flmcr1)..................................................... 544 18.5.2 flash memory control register 2 (flmcr2)..................................................... 547 18.5.3 erase block register 1 (ebr1) ........................................................................... 548 18.5.4 ram emulation register (ramer)................................................................... 549 18.6 on-board programming modes........................................................................................ 550 18.6.1 boot mode ........................................................................................................... 551 18.6.2 user program mode............................................................................................. 555 18.7 programming/erasing flash memory ............................................................................... 556 18.7.1 program mode ..................................................................................................... 556 18.7.2 program-verify mode.......................................................................................... 557 18.7.3 erase mode .......................................................................................................... 559 18.7.4 erase-verify mode .............................................................................................. 559 18.8 protection ................................................................................................................. ......... 561 18.8.1 hardware protection ............................................................................................ 561 18.8.2 software protection.............................................................................................. 562 18.8.3 error protection.................................................................................................... 563 18.9 flash memory emulation in ram ................................................................................... 565 18.10 note on flash memory programming/erasing ................................................................. 567 18.11 flash memory programmer mode .................................................................................... 567 18.11.1 socket adapter pin correspondence diagram..................................................... 568 18.11.2 programmer mode operation .............................................................................. 570 18.11.3 memory read mode ............................................................................................ 571 18.11.4 auto-program mode ............................................................................................ 575 18.11.5 auto-erase mode................................................................................................. 578 18.11.6 status read mode ................................................................................................ 579 18.11.7 status polling ....................................................................................................... 581 18.11.8 programmer mode transition time .................................................................... 582 18.11.9 notes on memory programming......................................................................... 583 18.12 notes when converting the f-ztat application software to the mask-rom versions ....................................................................................................................... ..... 583 section 19 rom (256 kb version) ................................................................................ 585 19.1 features ................................................................................................................... .......... 585 19.2 overview................................................................................................................... ........ 586 19.2.1 block diagram..................................................................................................... 586 19.2.2 mode transitions ................................................................................................. 587 19.2.3 on-board programming modes........................................................................... 588
rev. 5.00 jan 06, 2006 page xviii of xx 19.2.4 flash memory emulation in ram ...................................................................... 590 19.2.5 differences between boot mode and user program mode ................................. 591 19.2.6 block configuration ............................................................................................ 592 19.3 pin configuration.......................................................................................................... .... 593 19.4 register configuration..................................................................................................... . 594 19.5 register descriptions ...................................................................................................... .. 595 19.5.1 flash memory control register 1 (flmcr1)..................................................... 595 19.5.2 flash memory control register 2 (flmcr2)..................................................... 598 19.5.3 erase block register 1 (ebr1) ........................................................................... 601 19.5.4 erase block register 2 (ebr2) ........................................................................... 602 19.5.5 ram emulation register (ramer)................................................................... 603 19.6 on-board programming modes........................................................................................ 604 19.6.1 boot mode ........................................................................................................... 605 19.6.2 user program mode............................................................................................. 609 19.7 programming/erasing flash memory ............................................................................... 610 19.7.1 program mode (n = 1 for addresses h'0000 to h'1ffff, n = 2 for addresses h'20000 to h'3ffff)........................................................... 610 19.7.2 program-verify mode (n = 1 for addresses h'0000 to h'1ffff, n = 2 for addresses h'20000 to h'3ffff)........................................................... 611 19.7.3 erase mode (n = 1 for addresses h'0000 to h'1ffff, n = 2 for addresses h'20000 to h'3ffff)........................................................... 613 19.7.4 erase-verify mode (n = 1 for addresses h'0000 to h'1ffff, n = 2 for addresses h'20000 to h'3ffff)........................................................... 613 19.8 protection ................................................................................................................. ......... 615 19.8.1 hardware protection ............................................................................................ 615 19.8.2 software protection.............................................................................................. 616 19.8.3 error protection.................................................................................................... 617 19.9 flash memory emulation in ram ................................................................................... 619 19.10 note on flash memory programming/erasing ................................................................. 621 19.11 flash memory programmer mode .................................................................................... 621 19.11.1 socket adapter pin correspondence diagram..................................................... 622 19.11.2 programmer mode operation .............................................................................. 624 19.11.3 memory read mode ............................................................................................ 625 19.11.4 auto-program mode ............................................................................................ 629 19.11.5 auto-erase mode................................................................................................. 631 19.11.6 status read mode ................................................................................................ 633 19.11.7 status polling ....................................................................................................... 635 19.11.8 programmer mode transition time .................................................................... 636 19.11.9 cautions concerning memory programming ...................................................... 637 19.12 notes when converting the f-ztat application software to the mask-rom versions ....................................................................................................................... ..... 637
rev. 5.00 jan 06, 2006 page xix of xx section 20 ram .................................................................................................................. 639 20.1 overview................................................................................................................... ........ 639 20.2 operation .................................................................................................................. ........ 640 section 21 power-down state ......................................................................................... 641 21.1 overview................................................................................................................... ........ 641 21.1.1 power-down states.............................................................................................. 641 21.1.2 pin configuration................................................................................................. 643 21.1.3 related register ................................................................................................... 643 21.2 register descriptions ...................................................................................................... .. 644 21.2.1 standby control register (sbycr) .................................................................... 644 21.2.2 system control register (syscr) ...................................................................... 645 21.3 hardware standby mode .................................................................................................. 646 21.3.1 transition to hardware standby mode ................................................................ 646 21.3.2 exit from hardware standby mode ..................................................................... 646 21.3.3 hardware standby mode timing......................................................................... 646 21.4 software standby mode.................................................................................................... 64 7 21.4.1 transition to software standby mode ................................................................. 647 21.4.2 canceling the software standby mode................................................................ 649 21.4.3 software standby mode application example.................................................... 650 21.5 sleep mode ................................................................................................................. ...... 651 21.5.1 transition to sleep mode..................................................................................... 651 21.5.2 canceling sleep mode ......................................................................................... 651 section 22 electrical characteristics .............................................................................. 653 22.1 absolute maximum ratings ............................................................................................. 653 22.2 dc characteristics ......................................................................................................... ... 654 22.2.1 notes on using..................................................................................................... 656 22.3 ac characteristics ......................................................................................................... ... 657 22.3.1 clock timing ....................................................................................................... 657 22.3.2 control signal timing ......................................................................................... 659 22.3.3 bus timing .......................................................................................................... 662 22.3.4 direct memory access controller timing .......................................................... 666 22.3.5 advanced timer unit timing and advanced pulse controller timing .............. 668 22.3.6 i/o port timing.................................................................................................... 669 22.3.7 watchdog timer timing...................................................................................... 670 22.3.8 serial communication interface timing.............................................................. 670 22.3.9 a/d converter timing......................................................................................... 671 22.3.10 measuring conditions for ac characteristics ..................................................... 673 22.4 a/d converter characteristics .......................................................................................... 674
rev. 5.00 jan 06, 2006 page xx of xx appendix a on-chip supporting module registers ................................................ 675 a.1 addresses ................................................................................................................... ....... 675 a.2 registers................................................................................................................... ......... 692 a.3 register states at reset and in power-down state ........................................................... 808 appendix b pin states ....................................................................................................... 812 b.1 pin states at reset and in power-down, and bus right released state ........................... 812 b.2 pin states of bus related signals ..................................................................................... 815 appendix c product code lineup .................................................................................. 816 appendix d package dimensions .................................................................................. 817
section 1 overview rev. 5.00 jan 06, 2006 page 1 of 818 rej09b0273-0500 section 1 overview 1.1 features the sh7050 series is a single-chip risc microcontroller that integrates a risc cpu core using an original renesas architecture with peripheral functions required for system configuration. the cpu has a risc-type instruction set. most instructions can be executed in one state (one system clock cycle), which greatly improves instruction execution speed. in addition, the 32-bit internal architecture enhances data processing power. with this cpu, it has become possible to assemble low-cost, high-performance/high-functionality systems even for applications such as real-time control, which could not previously be handled by microcontrollers because of their high-speed processing requirements. in addition, the sh7050 series includes on-chip peripheral functions necessary for synchronous configuration, such as large-capacity rom and ram, a direct memory access controller (dmac), timers, a serial communication interface (sci), a/d converter, interrupt controller (intc), and i/o ports. rom and sram can be directly connected by means of an external memory access support function, greatly reducing system cost. there are versions of on-chip rom: mask rom and f-ztat tm (flexible zero turn around time) with flash memory. the flash memory can be programmed with a programmer that supports sh7050 series programming, and can also be programmed and erased by software. this enables the chip to be programmed on the user side while mounted on a board. the features of the sh7050 series are summarized in table 1.1. note : f-ztat is a trademark of renesas technology corp.
section 1 overview rev. 5.00 jan 06, 2006 page 2 of 818 rej09b0273-0500 table 1.1 sh7050 series features item features cpu ? original renesas architecture ? 32-bit internal architecture ? general register machine ? sixteen 32-bit general registers ? three 32-bit control registers ? four 32-bit system registers ? risc-type instruction set ? fixed 16-bit instruction length for improved code efficiency ? load-store architecture (basic operations are executed between registers) ? delayed unconditional/conditional branch instructions reduce pipeline disruption during branches ? c-oriented instruction set ? instruction execution time: basic instructions execute in one state (50 ns/instruction at 20 mhz operation) ? address space: architecture supports 4 gbytes ? on-chip multiplier: multiply operations (32 bits 32 bits 64 bits) and multiply-and-accumulate operations (32 bits 32 bits + 64 bits 64 bits) executed in two to four states ? five-stage pipeline
section 1 overview rev. 5.00 jan 06, 2006 page 3 of 818 rej09b0273-0500 item features operating states ? operating modes ? single-chip mode ? 8/16-bit bus expanded mode (area 0 only set by mode pins) ? mode with on-chip rom  mode with no on-chip rom ? processing states ? power-on reset state ? program execution state ? exception handling state ? bus-released state ? power-down state ? power-down state ? sleep mode ? software standby mode ? hardware standby mode interrupt controller (intc) ? nine external interrupt pins (nmi, irq0 to irq7 ) ? 66 internal interrupt sources (atu 44, sci 12, dmac 4, a/d 2, wdt 1, ubc 1, cmt 2) ? 16 programmable priority levels user break controller (ubc) ? requests an interrupt when the cpu or dmac generates a bus cycle with specified conditions ? simplifies configuration of an on-chip debugger clock pulse generator (cpg/pll) ? on-chip clock pulse generator (maximum operating frequency: 20 mhz) ? on-chip clock-multiplication pll circuit ( 1, 2, 4) external input frequency range: 4 to 10 mhz
section 1 overview rev. 5.00 jan 06, 2006 page 4 of 818 rej09b0273-0500 item features bus state controller (bsc) ? supports external memory access (sram and rom directly connectable) ? 8/16-bit external data bus ? external address space divided into four areas, with the following parameters settable for each area: ? bus size (8 or 16 bits) ? number of wait cycles ? chip select signals ( cs0 to cs3 ) output for each area ? wait cycles can be inserted using an external wait signal ? external access in minimum of two cycles ? provision for idle cycle insertion to prevent bus collisions (between external space read and write cycles, etc.) direct memory access controller (dmac) (4 channels) ? dma transfer possible for the following devices: ? external memory, external i/o, external memory, on-chip supporting modules (excluding dmac, ubc, bsc) ? dma transfer requests by external pins, on-chip sci, on-chip a/d converter, on-chip atu ? cycle stealing or burst transfer ? relative channel priorities can be set ? channels 0 and 1: selection of dual or single address mode transfer, external requests possible channels 2 and 3: dual address mode transfer and internal requests only ? source address reload function (channel 2 only) ? can be switched between direct address transfer mode and indirect address transfer mode (channel 3 only) ? direct address transfer mode: transfers the data at the transfer source address to the transfer destination address ? indirect address transfer mode: regards the data at the transfer source address as an address, and transfers the data at that address to the transfer destination address
section 1 overview rev. 5.00 jan 06, 2006 page 5 of 818 rej09b0273-0500 item features advanced timer unit (atu) ? built-in two-stage prescaler ? total of 18 counters: ten free-running counters, eight down-counters ? maximum 34 pulse inputs or outputs can be processed ? four 32-bit input capture inputs ? eight 16-bit one-shot pulse outputs ? eighteen 16-bit input capture inputs/output compare outputs ? four 16-bit pwm outputs ? one 16-bit input capture input (no pin) advanced pulse controller (apc) ? maximum eight pulse outputs watchdog timer (wdt) (1 channel) ? can be switched between watchdog timer and interval timer function ? internal reset, external signal, or interrupt generated by counter overflow serial communication interface (sci) (3 channels) ? selection of asynchronous or synchronous mode ? simultaneous transmission/reception (full-duplex) capability ? built-in dedicated baud rate generator ? multiprocessor communication function a/d converter ? 10-bit resolution ? sixteen channels ? two sample-and-hold circuit function units (independent operation of 12 channels and 4 channels) ? selection of single mode or scan mode ? can be activated by external trigger or atu compare-match ? adend output at end of a/d conversion (a/d1 module only) compare-match timer (cmt) (2 channels) ? selection of 4 counter input clocks ? a compare-match interrupt can be requested independently for each channel i/o ports ? total of 118 pins (multiplex ports): 102 input/output, 16 input ? input or output can be specified bit by bit
section 1 overview rev. 5.00 jan 06, 2006 page 6 of 818 rej09b0273-0500 item features model large-capacity on-chip memory memory sh7050 sh7051 mask rom 128 kb ? ? flash memory ? 128 kb 256 kb ram 6 kb 6 kb 10 kb product lineup model on-chip rom operating voltage operating frequency product code package sh7050 mask rom 5.0 v 4 to 20 mhz hd6437050f20 flash memory 5.0 v 4 to 20 mhz hd64f7050sf20 sh7051 flash memory 5.0 v 4 to 20 mhz hd64f7051sf20 168-pin plastic qfp (prqp0168ja-a)
section 1 overview rev. 5.00 jan 06, 2006 page 7 of 818 rej09b0273-0500 1.2 block diagram rom (flash/mask) ram direct memory access controller (4 channels) serial communi- cation interface (3 channels) advanced timer unit compare-match timer (2 channels) a/d converter watchdog timer bus state controller interrupt controller clock pulse generator port/control signals port port port/address signals pc14/toh10 pc13/tog10 pc12/tof10/drak1 pc11/toe10/drak0 pc10/tod10 pc9/toc10 pc8/tob10 pc7/toa10 pg13/tiod4 pg12/tioc4 pg11/tiob4 pg10/tioa4 pg9/tiod3 pe14/tioc3 pe13/tiob3 pe12/tioa3 pe7/tiob2 pe6/tioa2 pe5/tiof1 pe4/tioe1 pe3/tiod1 pe2/tioc1 pe1/tiob1 pe0/tioa1 pe11/tid0 pe10/tic0 pe9/tib0 pe8/tia0 pb5/tclkb pb4/tclka pd15/d15 pd14/d14 pd13/d13 pd12/d12 pd11/d11 pd10/d10 pd9/d9 pd8/d8 pd7/d7 pd6/d6 pd5/d5 pd4/d4 pd3/d3 pd2/d2 pd1/d1 pd0/d0 pg0/ adtrg / irqou t pg1/sck0 pg2/txd0 pg3/rxd0 pg4/sck1 pg5/txd1 pg6/rxd1 pf8/sck2/puls4 pg7/txd2 pg8/rxd2 pf0/ irq0 pf1/ irq1 pf2/ irq2 pf3/ irq3 pg14/ irq4 /tioa5 pg15/ irq5 /tiob5 pf7/ dreq0 /puls3 pf6/dack0/puls2 pf5/ dreq1 /puls1 pf4/dack1/puls0 pf4/ breq /puls7 pf5/ back /puls6 pc2/ wait pc3/ rd pc1/ wrh pc0/ wrl pf9/ cs3 / irq7 /puls5 pc6/ cs2 / irq6 /adend pc5/ cs1 pc4/ cs0 pb11/a21/ pod pb10/a20 pb9/a19 pb8/a18 pb7/a17 pb6/a16 pa15/a15 pa14/a14 pa13/a13 pa12/a12 pa11/a11 pa10/a10 pa9/a9 pa8/a8 pa7/a7 pa6/a6 pa5/a5 pa4/a4 pa3/a3 pa2/a2 pa1/a1 pa0/a0 ph15/an15 ph14/an14 ph13/an13 ph12/an12 ph11/an11 ph10/an10 ph9/an9 ph8/an8 ph7/an7 ph6/an6 ph5/an5 ph4/an4 ph3/an3 ph2/an2 ph1/an1 ph0/an0 pb0/to6 pb1/to7 pb2/to8 pb3/to9 ck extal xtal pllv cc pllv ss pllcap v cc ( * ) res hstby md3 md2 md1 md0 nmi wdtovf port/data signals port port : peripheral address bus (24 bits) : peripheral data bus (16 bits) : internal address bus (24 bits) : internal upper data bus (16 bits) : internal lower data bus (16 bits) note: * mask rom version cpu multiplier figure 1.1 block diagram
section 1 overview rev. 5.00 jan 06, 2006 page 8 of 818 rej09b0273-0500 1.3 pin arrangement and pin functions 1.3.1 pin arrangement pg9/tiod3 pg10/tioa4 pg11/tiob4 pg12/tioc4 pg13/tiod4 pg14/ irq4 /tioa5 v ss pg15/ irq5 /tiob5 pb0/to6 pb1/to7 pb2/to8 pb3/to9 v cc pb4/tclka v ss pb5/tclkb pa0/a0 pa1/a1 pa2/a2 pa3/a3 v cc pa4/a4 v ss pa5/a5 pa6/a6 pa7/a7 pa8/a8 pa9/a9 v cc pa10/a10 v ss pa11/a11 pa12/a12 pa13/a13 pa14/a14 pa15/a15 v cc pb6/a16 v ss pb7/a17 pb8/a18 pb9/a19 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 prqp0168ja-a res ck hstby pllv ss pllcap pllv cc md0 md1 fwe (nc * ) pf3/ irq3 pf2/ irq2 v ss pf1/ irq1 v cc nmi md2 extal md3 xtal v ss pf0/ irq0 v cc pd15/d15 pd14/d14 pd13/d13 pd12/d12 pd11/d11 v ss pd10/d10 v cc pd9/d9 pd8/d8 pd7/d7 pd6/d6 pd5/d5 v ss pd4/d4 v cc pd3/d3 pd2/d2 pd1/d1 pd0/d0 pg8/rxd2 pg7/txd2 pg6/rxd1 pg5/txd1 v ss pg4/sck1 pg3/rxd0 pg2/txd0 pg1/sck0 pg0/ adtrg / irqout v cc ph15/an15 ph14/an14 ph13/an13 ph12/an12 ph11/an11 av ss ph10/an10 av cc av ref ph9/an9 ph8/an8 ph7/an7 ph6/an6 av ss ph5/an5 av cc ph4/an4 ph3/an3 ph2/an2 ph1/an1 ph0/an0 v ss pf11/ breq /puls7 pf10/ back /puls6 pf9/ cs3 / irq7 /puls5 pf8/sck2/puls4 pf7/ dreq0 /puls3 v cc pf6/dack0/puls2 pf5/ dreq1 /puls1 pf4/dack1/puls0 pb10/a20 pb11/a21/ pod pc0/ wrl pc1/ wrh v cc pc2/ wait v ss pc3/ rd wdtovf pc4/ cs0 pc5/ cs1 pc6/ cs2 / irq6 /adend v cc pc7/toa10 v ss pc8/tob10 pc9/toc10 pc10/tod10 pc11/toe10/drak0 pc12/tof10/drak1 pc13/tog10 v ss pc14/toh10 pe0/tioa1 pe1/tiob1 pe2/tioc1 pe3/tiod1 v ss pe4/tioe1 v cc pe5/tiof1 pe6/tioa2 pe7/tiob2 pe8/tia0 pe9/tib0 pe10/tic0 v cc pe11/tid0 v ss pe12/tioa3 pe13/tiob3 pe14/tioc3 note: * mask rom version figure 1.2 pin arrangement
section 1 overview rev. 5.00 jan 06, 2006 page 9 of 818 rej09b0273-0500 1.3.2 pin functions table 1.2 summarizes the pin functions. table 1.2 pin functions type symbol pin no. i/o name function power supply v cc 13, 21, 29, 37, 47, 55, 72, 79, 89, 97, 105, 113, 130, 158 input power supply for connection to the power supply. connect all v cc pins to the system power supply. the chip will not operate if there are any open pins. v ss 7, 15, 23, 31, 39, 49, 57, 64, 70, 81, 91, 99, 107, 115, 136, 164 input ground for connection to ground. connect all v ss pins to the system ground. the chip will not operate if there are any open pins. flash memory fwe 118 input flash write enable connected to ground in normal operation. apply v cc during on-board programming. (not included in mask rom version.) clock pllv cc 121 input pll power supply on-chip pll oscillator power supply. for power supply connection, see section 4, clock pulse generator. pllv ss 123 input pll ground on-chip pll oscillator ground. for power supply connection, see section 4, clock pulse generator. pllcap 122 input pll capacitance on-chip pll oscillator external capacitance connection pin. for external capacitance connection, see section 4, clock pulse generator.
section 1 overview rev. 5.00 jan 06, 2006 page 10 of 818 rej09b0273-0500 type symbol pin no. i/o name function clock extal 110 input external clock for connection to a crystal resonator. an external clock source can also be connected to the extal pin. xtal 108 input crystal for connection to a crystal resonator. ck 125 output system clock supplies the system clock to peripheral devices. system control res 126 input power-on reset executes a power-on reset when driven low. wdtovf 51 output watchdog timer overflow wdt overflow output signal. breq 135 input bus request driven low when an external device requests the bus. back 134 output bus request acknowledge indicates that the bus has been granted to an external device. the device that output the breq signal recognizes that the bus has been acquired when it receives the back signal. operating mode control md0 to md3 120, 119, 111, 109 input mode setting these pins determine the operating mode. do not change the input values during operation. hstby 124 input hardware standby when driven low, this pin forces a transition to hardware standby mode. interrupts nmi 112 input nonmaskable interrupt nonmaskable interrupt request pin. acceptance on the rising edge or falling edge can be selected. irq0 to irq7 106, 114, 116, 117, 6, 8, 54, 133 input interrupt requests 0 to 7 maskable interrupt request pins. level input or edge input can be selected.
section 1 overview rev. 5.00 jan 06, 2006 page 11 of 818 rej09b0273-0500 type symbol pin no. i/o name function interrupts irqout 159 output interrupt request output indicates that an interrupt has been generated. enables interrupt generation to be recognized in the bus- released state. address bus a0 ? a21 17 ? 20, 22, 24 ? 28, 30, 32 ? 36, 38, 40 ? 44 output address bus address output pins. data bus d0 ? d15 85 ? 88, 90, 92 ? 96, 98, 100 ? 104 input/ output data bus 16-bit bidirectional data bus pins. bus control cs0 ? cs3 52 ? 54, 133 output chip select 0 to 3 chip select signals for external memory or devices. rd 50 output read indicates reading from an external device. wrh 46 output upper write indicates writing of the upper 8 bits of external data. wrl 45 output lower write indicates writing of the lower 8 bits of external data. wait 48 input wait input for wait cycle insertion in bus cycles during external space access. dreq0 ? dreq1 131, 128 input dma transfer request (channels 0, 1) input pin for external requests for dma transfer. direct memory access controller (dmac) drak0 ? drak1 61, 62 output dreq request acknowledg- ment (channels 0, 1) these pins output the input sampling acknowledgment for external requests for dma transfer. dack0 ? dack1 129, 127 output dma transfer strobe (channels 0, 1) these pins output a strobe to the external i/o of external dma transfer requests.
section 1 overview rev. 5.00 jan 06, 2006 page 12 of 818 rej09b0273-0500 type symbol pin no. i/o name function tclka tclkb 14 16 input atu timer clock input atu counter external clock input pins. advanced timer unit (atu) tia0 tib0 tic0 tid0 76 77 78 80 input atu input capture (channel 0) channel 0 input capture input pins. tioa1 tiob1 tioc1 tiod1 tioe1 tiof1 66 67 68 69 71 73 input/ output atu input capture/output compare (channel 1) channel 1 input capture input/output compare output pins. tioa2 tiob2 74 75 input/ output atu input capture/output compare (channel 2) channel 2 input capture input/output compare output pins. tioa3 tiob3 tioc3 tlod3 82 83 84 1 input/ output atu input capture/output compare/ pwm output (channel 3) channel 3 input capture input/output compare/pwm output pins. tioa4 tiob4 tioc4 tiod4 2 3 4 5 input/ output atu input capture/output compare/ pwm output (channel 4) channel 4 input capture input/output compare/pwm output pins. tioa5 tiob5 6 8 input/ output atu input capture/output compare/ pwm output (channel 5) channel 5 input capture input/output compare/pwm output pins. to6 to7 to8 to9 9 10 11 12 output atu pwm output (channels 6 to 9) channel 6 to 9 pwm output pins.
section 1 overview rev. 5.00 jan 06, 2006 page 13 of 818 rej09b0273-0500 type symbol pin no. i/o name function advanced timer unit (atu) toa10 tob10 toc10 tod10 toe10 tof10 tog10 toh10 56 58 59 60 61 62 63 65 output atu one-shot pulse (channel 10) channel 10 down-counter one-shot pulse output pins. advanced pulse controller (apc) puls0 ? puls7 127 ? 129, 131 ? 135 output apc pulse outputs 0 to 7 apc pulse output pins. serial communication interface (sci) txd0 ? txd2 161, 165, 167 output transmit data (channels 0 to 2) sci0 to sci2 transmit data output pins. rxd0 ? rsd2 162, 166, 168 input receive data (channels 0 to 2) sci0 to sci2 receive data input pins. sck0 ? sck2 160, 163, 132 input/ output serial clock (channels 0 to 2) sci0 to sci2 clock input/output pins. a/d converter av cc 142, 150 input analog power supply a/d converter power supply. av ss 144, 152 input analog ground a/d converter power supply. av ref 149 input analog reference power supply analog reference power supply input pin. an0 ? an15 137 ? 141, 143,145 ? 148, 151, 153 ? 157 input analog input analog signal input pins. adtrg 159 input a/d conversion trigger input external trigger input for starting a/d conversion. adend 54 output adend output a/d1 channel 15 conversion timing monitor output pin.
section 1 overview rev. 5.00 jan 06, 2006 page 14 of 818 rej09b0273-0500 type symbol pin no. i/o name function i/o ports pod 44 input port output disable input pin for port pin drive control when general port is set for output. pa0 ? pa15 17 ? 20, 22, 24 ? 28, 30, 32 ? 36 input/ output port a general input/output port pins. input or output can be specified bit by bit. pb0 ? pb11 9 ? 12, 14, 16, 38, 40 ? 44 input/ output port b general input/output port pins. input or output can be specified bit by bit. pc0 ? pc14 45, 46, 48, 50, 52 ? 54, 56, 58 ? 63, 65 input/ output port c general input/output port pins. input or output can be specified bit by bit. pd0 ? pd15 85 ? 88, 90, 92 ? 96, 98, 100 ? 104 input/ output port d general input/output port pins. input or output can be specified bit by bit. pe0 ? pe14 66 ? 69, 71, 73 ? 78, 80, 82 ? 84 input/ output port e general input/output port pins. input or output can be specified bit by bit. pf0 ? pf11 106, 114, 116, 117, 127 ? 129, 131 ? 135 input/ output port f general input/output port pins. input or output can be specified bit by bit. pg0 ? pg15 159 ? 163, 165 ? 168, 1 ? 6, 8 input/ output port g general input/output port pins. input or output can be specified bit by bit. ph0 ? ph15 137 ? 141, 143, 145 ? 148, 151, 153 ? 157 input port h general input port pins.
section 1 overview rev. 5.00 jan 06, 2006 page 15 of 818 rej09b0273-0500 1.3.3 pin assignments table 1.3 pin assignments pin no. mcu mode programmer mode 1 pg9/tiod3 v cc 2 pg10/tioa4 v cc 3 pg11/tiob4 n.c. 4 pg12/tioc4 n.c. 5 pg13/tiod4 v cc 6 pg14/ irq4 /tioa5 n.c. 7v ss v ss 8 pg15/ irq5 /tiob5 n.c. 9 pb0/to6 n.c. 10 pb1/to7 n.c. 11 pb2/to8 n.c. 12 pb3/to9 n.c. 13 v cc v cc 14 pb4/tclka n.c. 15 v ss v ss 16 pb5/tclkb n.c. 17 pa0/a0 a0 18 pa1/a1 a1 19 pa2/a2 a2 20 pa3/a3 a3 21 v cc v cc 22 pa4/a4 a4 23 v ss v ss 24 pa5/a5 a5 25 pa6/a6 a6 26 pa7/a7 a7 27 pa8/a8 a8 28 pa9/a9 oe 29 v cc v cc
section 1 overview rev. 5.00 jan 06, 2006 page 16 of 818 rej09b0273-0500 pin no. mcu mode programmer mode 30 pa10/a10 a10 31 v ss v ss 32 pa11/a11 a11 33 pa12/a12 a12 34 pa13/a13 a13 35 pa14/a14 a14 36 pa15/a15 a15 37 v cc v cc 38 pb6/a16 a16 39 v ss v ss 40 pb7/a17 v ss (hd64f7050s)/a17 (hd64f7051s) 41 pb8/a18 ce 42 pb9/a19 we 43 pb10/a20 n.c. 44 pb11/a21/ pod n.c. 45 pc0/ wrl n.c. 46 pc1/ wrh n.c. 47 v cc v cc 48 pc2/ wait n.c. 49 v ss v ss 50 pc3/ rd n.c. 51 wdtovf n.c. 52 pc4/ cs0 n.c. 53 pc5/ cs1 n.c. 54 pc6/ cs2 / irq6 /adend n.c. 55 v cc v cc 56 pc7/toa10 n.c. 57 v ss v ss 58 pc8/tob10 n.c. 59 pc9/toc10 n.c. 60 pc10/tod10 n.c. 61 pc11/toe10/drak0 n.c.
section 1 overview rev. 5.00 jan 06, 2006 page 17 of 818 rej09b0273-0500 pin no. mcu mode programmer mode 62 pc12/tof10/drak1 n.c. 63 pc13/tog10 n.c. 64 v ss v ss 65 pc14/toh10 n.c. 66 pe0/tioa1 n.c. 67 pe1/tiob1 n.c. 68 pe2/tioc1 n.c. 69 pe3/tiod1 n.c. 70 v ss v ss 71 pe4/tioe1 n.c. 72 v cc v cc 73 pe5/tiof1 n.c. 74 pe6/tioa2 n.c. 75 pe7/tiob2 n.c. 76 pe8/tia0 n.c. 77 pe9/tib0 n.c. 78 pe10/tic0 n.c. 79 v cc v cc 80 pe11/tid0 n.c. 81 v ss v ss 82 pe12/tioa3 n.c. 83 pe13/tiob3 n.c. 84 pe14/tioc3 n.c. 85 pd0/d0 i/o0 86 pd1/d1 i/o1 87 pd2/d2 i/o2 88 pd3/d3 i/o3 89 v cc v cc 90 pd4/d4 i/o4 91 v ss v ss 92 pd5/d5 i/o5 93 pd6/d6 i/o6
section 1 overview rev. 5.00 jan 06, 2006 page 18 of 818 rej09b0273-0500 pin no. mcu mode programmer mode 94 pd7/d7 i/o7 95 pd8/d8 n.c. 96 pd9/d9 n.c. 97 v cc v cc 98 pd10/d10 n.c. 99 v ss v ss 100 pd11/d11 n.c. 101 pd12/d12 n.c. 102 pd13/d13 n.c. 103 pd14/d14 n.c. 104 pd15/d15 n.c. 105 v cc v cc 106 pf0/ irq0 n.c. 107 v ss v ss 108 xtal xtal 109 md3 v cc 110 extal extal 111 md2 v cc 112 nmi a9 113 v cc v cc 114 pf1/ irq1 n.c. 115 v ss v ss 116 pf2/ irq2 n.c. 117 pf3/ irq3 n.c. 118 fwe (nc * )fwe 119 md1 v ss 120 md0 v cc 121 pllv cc pllv cc 122 pllcap pllcap 123 pllv ss pllv ss 124 hstby v cc 125 ck n.c.
section 1 overview rev. 5.00 jan 06, 2006 page 19 of 818 rej09b0273-0500 pin no. mcu mode programmer mode 126 res res 127 pf4/dack1/puls0 n.c. 128 pf5/ dreq1 /puls1 n.c. 129 pf6/dack0/puls2 n.c. 130 v cc v cc 131 pf7/ dreq0 /puls3 n.c. 132 pf8/sck2/puls4 n.c. 133 pf9/ cs3 / irq7 /puls5 n.c. 134 pf10/ back /puls6 n.c. 135 pf11/ breq /puls7 n.c. 136 v ss v ss 137 ph0/an0 n.c. 138 ph1/an1 n.c. 139 ph2/an2 n.c. 140 ph3/an3 n.c. 141 ph4/an4 n.c. 142 av cc v cc 143 ph5/an5 n.c. 144 av ss v ss 145 ph6/an6 n.c. 146 ph7/an7 n.c. 147 ph8/an8 n.c. 148 ph9/an9 n.c. 149 av ref v cc 150 av cc v cc 151 ph10/an10 n.c. 152 av ss v ss 153 ph11/an11 n.c. 154 ph12/an12 n.c. 155 ph13/an13 n.c. 156 ph14/an14 n.c. 157 ph15/an15 n.c.
section 1 overview rev. 5.00 jan 06, 2006 page 20 of 818 rej09b0273-0500 pin no. mcu mode programmer mode 158 v cc v cc 159 pg0/ adtrg / irqout n.c. 160 pg1/sck0 n.c. 161 pg2/txd0 n.c. 162 pg3/rxd0 n.c. 163 pg4/sck1 n.c. 164 v ss v ss 165 pg5/txd1 n.c. 166 pg6/rxd1 n.c. 167 pg7/txd2 n.c. 168 pg8/rxd2 n.c. note: * mask rom version
section 2 cpu rev. 5.00 jan 06, 2006 page 21 of 818 rej09b0273-0500 section 2 cpu 2.1 register configuration the register set consists of sixteen 32-bit general registers, three 32-bit control registers and four 32-bit system registers. 2.1.1 general registers (rn) the sixteen 32-bit general registers (rn) are numbered r0?r15. general registers are used for data processing and address calculation. r0 is also used as an index register. several instructions have r0 fixed as their only usable register. r15 is used as the hardware stack pointer (sp). saving and recovering the status register (sr) and program counter (pc) in exception processing is accomplished by referencing the stack using r15. figure 2.1 shows the general registers. r0 * 1 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15, sp (hardware stack pointer) * 2 0 31 1. 2. r0 functions as an index register in the indirect indexed register addressing mode and indirect indexed gbr addressing mode. in some instructions, r0 functions as a fixed source register or destination register. r15 functions as a hardware stack pointer (sp) during exception processing. notes: figure 2.1 general registers
section 2 cpu rev. 5.00 jan 06, 2006 page 22 of 818 rej09b0273-0500 2.1.2 control registers the 32-bit control registers consist of the 32-bit status register (sr), global base register (gbr), and vector base register (vbr). the status register indicates processing states. the global base register functions as a base address for the indirect gbr addressing mode to transfer data to the registers of on-chip peripheral modules. the vector base register functions as the base address of the exception processing vector area (including interrupts). figure 2.2 shows a control register. 9876543210 m q i3 i2 i1 i0 st 0 0 31 31 gbr vbr sr 31 s bit: used by the mac instruction. reserved bits. this bit always read 0. the write value should always be 0. reserved bits. 0 is read. write only. bits i0?i3: interrupt mask bits. m and q bits: used by the div0u, div0s, and div1 instructions. global base register (gbr): indicates the base address of the indirect gbr addressing mode. the indirect gbr addressing mode is used in data transfer for on-chip peripheral modules register areas and in logic operations. vector base register (vbr): stores the base address of the exception processing vector area. sr: status register t bit: the movt, cmp/cond, tas, tst, bt (bt/s), bf (bf/s), sett, and clrt instructions use the t bit to indicate true (1) or false (0). the addv, addc, subv, subc, div0u, div0s, div1, negc, shar, shal, shlr, shll, rotr, rotl, rotcr, and rotcl instructions also use the t bit to indicate carry/borrow or overflow/underflow. figure 2.2 control register configuration
section 2 cpu rev. 5.00 jan 06, 2006 page 23 of 818 rej09b0273-0500 2.1.3 system registers system registers consist of four 32-bit registers: high and low multiply and accumulate registers (mach and macl), the procedure register (pr), and the program counter (pc). the multiply and accumulate registers store the results of multiply and accumulate operations. the procedure register stores the return address from the subroutine procedure. the program counter stores program addresses to control the flow of the processing. figure 2.3 shows a system register. macl pr pc mach 31 0 0 0 31 31 multiply and accumulate (mac) registers high and low (mach, macl): stores the results of multiply and accumulate operations. procedure register (pr): stores a return address from a subroutine procedure. program counter (pc): indicates the fourth byte (second instruction) after the current instruction. figure 2.3 system register configuration 2.1.4 initial values of registers table 2.1 lists the values of the registers after reset. table 2.1 initial values of registers classification register initial value general registers r0 ? r14 undefined r15 (sp) value of the stack pointer in the vector address table control registers sr bits i3 ? i0 are 1111 (h'f), reserved bits are 0, and other bits are undefined gbr undefined vbr h'00000000 system registers mach, macl, pr undefined pc value of the program counter in the vector address table
section 2 cpu rev. 5.00 jan 06, 2006 page 24 of 818 rej09b0273-0500 2.2 data formats 2.2.1 data format in registers register operands are always longwords (32 bits). when the memory operand is only a byte (8 bits) or a word (16 bits), it is sign-extended into a longword when loaded into a register (figure 2.4). 31 0 longword figure 2.4 data format in registers 2.2.2 data format in memory memory data formats are classified into bytes, words, and longwords. byte data can be accessed from any address, but an address error will occur if you try to access word data starting from an address other than 2n or longword data starting from an address other than 4n. in such cases, the data accessed cannot be guaranteed. the hardware stack area, referred to by the hardware stack pointer (sp, r15), uses only longword data starting from address 4n because this area holds the program counter and status register (figure 2.5). 31 0 15 23 7 byte byte byte byte word word address 2n address 4n longword address m address m + 2 address m + 1 address m + 3 figure 2.5 data format in memory
section 2 cpu rev. 5.00 jan 06, 2006 page 25 of 818 rej09b0273-0500 2.2.3 immediate data format byte (8 bit) immediate data resides in an instruction code. immediate data accessed by the mov, add, and cmp/eq instructions is sign-extended and handled in registers as longword data. immediate data accessed by the tst, and, or, and xor instructions is zero-extended and handled as longword data. consequently, and instructions with immediate data always clear the upper 24 bits of the destination register. word or longword immediate data is not located in the instruction code, but instead is stored in a memory table. an immediate data transfer instruction (mov) accesses the memory table using the pc relative addressing mode with displacement. 2.3 instruction features 2.3.1 risc-type instruction set all instructions are risc type. this section details their functions. 16-bit fixed length : all instructions are 16 bits long, increasing program code efficiency. one instruction per cycle : the microprocessor can execute basic instructions in one cycle using the pipeline system. instructions are executed in 50 ns at 20 mhz. data length : longword is the standard data length for all operations. memory can be accessed in bytes, words, or longwords. byte or word data accessed from memory is sign-extended and handled as longword data. immediate data is sign-extended for arithmetic operations or zero- extended for logic operations. it also is handled as longword data (table 2.2). table 2.2 sign extension of word data sh7050 series cpu description example of conventional cpu mov.w @(disp,pc),r1 add r1,r0 ......... .data.w h'1234 data is sign-extended to 32 bits, and r1 becomes h'00001234. it is next operated upon by an add instruction. add.w #h'1234,r0 note: @(disp, pc) accesses the immediate data. load-store architecture : basic operations are executed between registers. for operations that involve memory access, data is loaded to the registers and executed (load-store architecture). instructions such as and that manipulate bits, however, are executed directly in memory.
section 2 cpu rev. 5.00 jan 06, 2006 page 26 of 818 rej09b0273-0500 delayed branch instructions : unconditional branch instructions are delayed. executing the instruction that follows the branch instruction and then branching reduces pipeline disruption during branching (table 2.3). there are two types of conditional branch instructions: delayed branch instructions and ordinary branch instructions. table 2.3 delayed branch instructions sh7050 series cpu description example of conventional cpu bra trget add r1,r0 executes an add before branching to trget add.w r1,r0 bra trget multiplication/accumulation operation : 16-bit 16-bit 32-bit multiplication operations are executed in one to two cycles. 16-bit 16-bit + 64-bit 64-bit multiplication/accumulation operations are executed in two to three cycles. 32-bit 32-bit 64-bit and 32-bit 32-bit + 64bit 64-bit multiplication/accumulation operations are executed in two to four cycles. t bit : the t bit in the status register changes according to the result of the comparison, and in turn is the condition (true/false) that determines if the program will branch. the number of instructions that change the t bit is kept to a minimum to improve the processing speed (table 2.4). table 2.4 t bit sh7050 series cpu description example of conventional cpu cmp/ge r1,r0 bt trget0 bf trget1 t bit is set when r0 cmp.w r1,r0 bge trget0 blt trget1 add #?1,r0 cmp/eq #0,r0 bt trget t bit is not changed by add. t bit is set when r0 = 0. the program branches if r0 = 0. sub.w #1,r0 beq trget
section 2 cpu rev. 5.00 jan 06, 2006 page 27 of 818 rej09b0273-0500 immediate data : byte (8 bit) immediate data resides in instruction code. word or longword immediate data is not input via instruction codes but is stored in a memory table. an immediate data transfer instruction (mov) accesses the memory table using the pc relative addressing mode with displacement (table 2.5). table 2.5 immediate data accessing classification sh7050 series cpu example of conventional cpu 8-bit immediate mov #h'12,r0 mov.b #h'12,r0 16-bit immediate mov.w @(disp,pc),r0 ................. .data.w h'1234 mov.w #h'1234,r0 32-bit immediate mov.l @(disp,pc),r0 ................. .data.l h'12345678 mov.l #h'12345678,r0 note: @(disp, pc) accesses the immediate data. absolute address : when data is accessed by absolute address, the value already in the absolute address is placed in the memory table. loading the immediate data when the instruction is executed transfers that value to the register and the data is accessed in the indirect register addressing mode (table 2.6). table 2.6 absolute address accessing classification sh7050 series cpu example of conventional cpu absolute address mov.l @(disp,pc),r1 mov.b @r1,r0 .................. .data.l h'12345678 mov.b @h'12345678,r0 note: @(disp,pc) accesses the immediate data.
section 2 cpu rev. 5.00 jan 06, 2006 page 28 of 818 rej09b0273-0500 16-bit/32-bit displacement : when data is accessed by 16-bit or 32-bit displacement, the pre- existing displacement value is placed in the memory table. loading the immediate data when the instruction is executed transfers that value to the register and the data is accessed in the indirect indexed register addressing mode (table 2.7). table 2.7 displacement accessing classification sh7050 series cpu example of conventional cpu 16-bit displacement mov.w @(disp,pc),r0 mov.w @(r0,r1),r2 .................. .data.w h'1234 mov.w @(h'1234,r1),r2 note: @(disp,pc) accesses the immediate data.
section 2 cpu rev. 5.00 jan 06, 2006 page 29 of 818 rej09b0273-0500 2.3.2 addressing modes table 2.8 describes addressing modes and effective address calculation. table 2.8 addressing modes and effective addresses addressing mode instruction format effective addresses calculation equation direct register addressing rn the effective address is register rn. (the operand is the contents of register rn.) ? indirect register addressing @rn the effective address is the content of register rn. rn rn rn post-increment indirect register addressing @rn+ the effective address is the content of register rn. a constant is added to the content of rn after the instruction is executed. 1 is added for a byte operation, 2 for a word operation, and 4 for a longword operation. rn rn 1/2/4 + rn + 1/2/4 rn (after the instruction executes) byte: rn + 1 @ ? rn the effective address is the value obtained by subtracting a constant from rn. 1 is subtracted for a byte operation, 2 for a word operation, and 4 for a longword operation. rn 1/2/4 rn ? 1/2/4 ? rn ? 1/2/4 byte: rn ? 1 ? 2 ? 4
section 2 cpu rev. 5.00 jan 06, 2006 page 30 of 818 rej09b0273-0500 addressing mode instruction format effective addresses calculation equation indirect register addressing with displacement @(disp:4, rn) the effective address is rn plus a 4-bit displacement (disp). the value of disp is zero- extended, and remains the same for a byte operation, is doubled for a word operation, and is quadrupled for a longword operation. rn rn + disp @(r0, rn) the effective address is the rn value plus r0. rn r0 rn + r0 + rn + r0 indirect gbr addressing with displacement @(disp:8, gbr) the effective address is the gbr value plus an 8-bit displacement (disp). the value of disp is zero- extended, and remains the same for a byte opera- tion, is doubled for a word operation, and is quadrupled for a longword operation. gbr 1/2/4 gbr + disp
section 2 cpu rev. 5.00 jan 06, 2006 page 31 of 818 rej09b0273-0500 addressing mode instruction format effective addresses calculation equation indirect indexed gbr addressing @(r0, gbr) the effective address is the gbr value plus the r0. gbr r0 gbr + r0 + gbr + r0 indirect pc addressing with displacement @(disp:8, pc) the effective address is the pc value plus an 8-bit displacement (disp). the value of disp is zero- extended, and is doubled for a word operation, and quadrupled for a longword operation. for a longword operation, the lowest two bits of the pc value are masked. pc h'fffffffc pc + disp
section 2 cpu rev. 5.00 jan 06, 2006 page 32 of 818 rej09b0273-0500 addressing mode instruction format effective addresses calculation equation pc relative addressing disp:8 the effective address is the pc value sign-extended with an 8-bit displacement (disp), doubled, and added to the pc value. pc 2 + disp:12 the effective address is the pc value sign-extended with a 12-bit displacement (disp), doubled, and added to the pc value. pc 2 + rn the effective address is the register pc value plus rn. pc rn pc + rn + pc + rn immediate addressing #imm:8 the 8-bit immediate data (imm) for the tst, and, or, and xor instructions are zero-extended. ? #imm:8 the 8-bit immediate data (imm) for the mov, add, and cmp/eq instructions are sign-extended. ? #imm:8 the 8-bit immediate data (imm) for the trapa instruction is zero-extended and is quadrupled. ?
section 2 cpu rev. 5.00 jan 06, 2006 page 33 of 818 rej09b0273-0500 2.3.3 instruction format table 2.9 lists the instruction formats for the source operand and the destination operand. the meaning of the operand depends on the instruction code. the symbols are used as follows: ? xxxx: instruction code ? mmmm: source register ? nnnn: destination register ? iiii: immediate data ? dddd: displacement table 2.9 instruction formats instruction formats source operand destination operand example 0 format xxxx xxxx xxxx xxxx 15 0 ?? nop ? nnnn: direct register movt rn n format xxxx xxxx xxxx nnnn 15 0 control register or system register nnnn: direct register sts mach,rn control register or system register nnnn: indirect pre-decrement register stc.l sr,@-rn mmmm: direct register control register or system register ldc rm,sr m format xxxx mmmm xxxx xxxx 15 0 mmmm: indirect post-increment register control register or system register ldc.l @rm+,sr mmmm: direct register ? jmp @rm mmmm: pc relative using rm ? braf rm
section 2 cpu rev. 5.00 jan 06, 2006 page 34 of 818 rej09b0273-0500 instruction formats source operand destination operand example mmmm: direct register nnnn: direct register add rm,rn nm format nnnn xxxx xxxx 15 0 mmmm mmmm: direct register nnnn: indirect register mov.l rm,@rn mmmm: indirect post-increment register (multiply/ accumulate) nnnn * : indirect post-increment register (multiply/ accumulate) mach, macl mac.w @rm+,@rn+ mmmm: indirect post-increment register nnnn: direct register mov.l @rm+,rn mmmm: direct register nnnn: indirect pre-decrement register mov.l rm,@-rn mmmm: direct register nnnn: indirect indexed register mov.l rm,@(r0,rn) md format xxxx dddd 15 0 mmmm xxxx mmmmdddd: indirect register with displacement r0 (direct register) mov.b @(disp,rm),r0 nd4 format xxxx xxxx dddd 15 0 nnnn r0 (direct register) nnnndddd: indirect register with displacement mov.b r0,@(disp,rn) mmmm: direct register nnnndddd: indirect register with displacement mov.l rm,@(disp,rn) nmd format nnnn xxxx dddd 15 0 mmmm mmmmdddd: indirect register with displacement nnnn: direct register mov.l @(disp,rm),rn
section 2 cpu rev. 5.00 jan 06, 2006 page 35 of 818 rej09b0273-0500 instruction formats source operand destination operand example d format dddd xxxx 15 0 xxxx dddd dddddddd: indirect gbr with displacement r0 (direct register) mov.l @(disp,gbr),r0 r0(direct register) dddddddd: indirect gbr with displacement mov.l r0,@(disp,gbr) dddddddd: pc relative with displacement r0 (direct register) mova @(disp,pc),r0 ? dddddddd: pc relative bf label d12 format dddd xxxx 15 0 dddd dddd ? dddddddddddd: pc relative bra label (label = disp + pc) nd8 format dddd nnnn xxxx 15 0 dddd dddddddd: pc relative with displacement nnnn: direct register mov.l @(disp,pc),rn iiiiiiii: immediate indirect indexed gbr and.b #imm,@(r0,gbr) i format xxxx xxxx i i i i 15 0 i i i i iiiiiiii: immediate r0 (direct register) and #imm,r0 iiiiiiii: immediate ? trapa #imm ni format nnnn i i i i xxxx 15 0 i i i i iiiiiiii: immediate nnnn: direct register add #imm,rn note: * in multiply/accumulate instructions, nnnn is the source register.
section 2 cpu rev. 5.00 jan 06, 2006 page 36 of 818 rej09b0273-0500 2.4 instruction set by classification table 2.10 classification of instructions classification types operation code function no. of instructions data transfer 5 mov data transfer, immediate data transfer, peripheral module data transfer, structure data transfer 39 mova effective address transfer movt t bit transfer swap swap of upper and lower bytes xtrct extraction of the middle of registers connected 21 add binary addition 33 arithmetic operations addc binary addition with carry addv binary addition with overflow check cmp/cond comparison div1 division div0s initialization of signed division div0u initialization of unsigned division dmuls signed double-length multiplication dmulu unsigned double-length multiplication dt decrement and test exts sign extension extu zero extension mac multiply/accumulate, double-length multiply/accumulate operation mul double-length multiply operation muls signed multiplication mulu unsigned multiplication neg negation negc negation with borrow sub binary subtraction subc binary subtraction with borrow subv binary subtraction with underflow
section 2 cpu rev. 5.00 jan 06, 2006 page 37 of 818 rej09b0273-0500 classification types operation code function no. of instructions 6 and logical and 14 logic operations not bit inversion or logical or tas memory test and bit set tst logical and and t bit set xor exclusive or shift 10 rotl one-bit left rotation 14 rotr one-bit right rotation rotcl one-bit left rotation with t bit rotcr one-bit right rotation with t bit shal one-bit arithmetic left shift shar one-bit arithmetic right shift shll one-bit logical left shift shlln n-bit logical left shift shlr one-bit logical right shift shlrn n-bit logical right shift branch 9 bf conditional branch, conditional branch with delay (branch when t = 0) 11 bt conditional branch, conditional branch with delay (branch when t = 1) bra unconditional branch braf unconditional branch bsr branch to subroutine procedure bsrf branch to subroutine procedure jmp unconditional branch jsr branch to subroutine procedure rts return from subroutine procedure
section 2 cpu rev. 5.00 jan 06, 2006 page 38 of 818 rej09b0273-0500 classification types operation code function no. of instructions 11 clrmac mac register clear 31 system control clrt t bit clear ldc load to control register lds load to system register nop no operation rte return from exception processing sett t bit set sleep shift into power-down mode stc storing control register data sts storing system register data trapa trap exception handling total: 62 142 table 2.11 shows the format used in tables 2.12 to 2.17, which list instruction codes, operation, and execution states in order by classification.
section 2 cpu rev. 5.00 jan 06, 2006 page 39 of 818 rej09b0273-0500 table 2.11 instruction code format item format explanation instruction op.sz src,dest op: operation code sz: size (b: byte, w: word, or l: longword) src: source dest: destination rm: source register rn: destination register imm: immediate data disp: displacement * 1 instruction code msb ? ? value when no wait states are inserted * 2 t bit ? value of t bit after instruction is executed. an em-dash ( ? ) in the column means no change. notes: 1. depending on the operand size, displacement is scaled sh-1/sh-2/sh-dsp software manual . 2. instruction execution cycles: the execution cycles shown in the table are minimums. the actual number of cycles may be increased when (1) contention occurs between instruction fetches and data access, or (2) when the destination register of the load instruction (memory
section 2 cpu rev. 5.00 jan 06, 2006 page 40 of 818 rej09b0273-0500 table 2.12 data transfer instructions instruction instruction code operation execu- tion cycles t bit mov #imm,rn 1110nnnniiiiiiii #imm ? mov.w @(disp,pc),rn 1001nnnndddddddd (disp ? mov.l @(disp,pc),rn 1101nnnndddddddd (disp ? mov rm,rn 0110nnnnmmmm0011 rm ? mov.b rm,@rn 0010nnnnmmmm0000 rm ? mov.w rm,@rn 0010nnnnmmmm0001 rm ? mov.l rm,@rn 0010nnnnmmmm0010 rm ? mov.b @rm,rn 0110nnnnmmmm0000 (rm) ? mov.w @rm,rn 0110nnnnmmmm0001 (rm) ? mov.l @rm,rn 0110nnnnmmmm0010 (rm) ? mov.b rm,@ ? rn 0010nnnnmmmm0100 rn ? 1 ? mov.w rm,@ ? rn 0010nnnnmmmm0101 rn ? 2 ? mov.l rm,@ ? rn 0010nnnnmmmm0110 rn ? 4 ? mov.b @rm+,rn 0110nnnnmmmm0100 (rm) ? mov.w @rm+,rn 0110nnnnmmmm0101 (rm) ? mov.l @rm+,rn 0110nnnnmmmm0110 (rm) ? mov.b r0,@(disp,rn) 10000000nnnndddd r0 ? mov.w r0,@(disp,rn) 10000001nnnndddd r0 ? mov.l rm,@(disp,rn) 0001nnnnmmmmdddd rm ? mov.b @(disp,rm),r0 10000100mmmmdddd (disp + rm) ? mov.w @(disp,rm),r0 10000101mmmmdddd (disp ? mov.l @(disp,rm),rn 0101nnnnmmmmdddd (disp ? mov.b rm,@(r0,rn) 0000nnnnmmmm0100 rm ?
section 2 cpu rev. 5.00 jan 06, 2006 page 41 of 818 rej09b0273-0500 instruction instruction code operation execu- tion cycles t bit mov.w rm,@(r0,rn) 0000nnnnmmmm0101 rm ? mov.l rm,@(r0,rn) 0000nnnnmmmm0110 rm ? mov.b @(r0,rm),rn 0000nnnnmmmm1100 (r0 + rm) ? mov.w @(r0,rm),rn 0000nnnnmmmm1101 (r0 + rm) ? mov.l @(r0,rm),rn 0000nnnnmmmm1110 (r0 + rm) ? mov.b r0,@(disp,gbr) 11000000dddddddd r0 ? mov.w r0,@(disp,gbr) 11000001dddddddd r0 ? mov.l r0,@(disp,gbr) 11000010dddddddd r0 ? mov.b @(disp,gbr),r0 11000100dddddddd (disp + gbr) ? mov.w @(disp,gbr),r0 11000101dddddddd (disp ? mov.l @(disp,gbr),r0 11000110dddddddd (disp ? mova @(disp,pc),r0 11000111dddddddd disp ? movt rn 0000nnnn00101001 t ? swap.b rm,rn 0110nnnnmmmm1000 rm ? swap.w rm,rn 0110nnnnmmmm1001 rm ? xtrct rm,rn 0010nnnnmmmm1101 rm: middle 32 bits of rn ?
section 2 cpu rev. 5.00 jan 06, 2006 page 42 of 818 rej09b0273-0500 table 2.13 arithmetic operation instructions instruction instruction code operation execu- tion cycles t bit add rm,rn 0011nnnnmmmm1100 rn + rm ? add #imm,rn 0111nnnniiiiiiii rn + imm ? addc rm,rn 0011nnnnmmmm1110 rn + rm + t addv rm,rn 0011nnnnmmmm1111 rn + rm cmp/eq #imm,r0 10001000iiiiiiii if r0 = imm, 1 cmp/eq rm,rn 0011nnnnmmmm0000 if rn = rm, 1 cmp/hs rm,rn 0011nnnnmmmm0010 if rn cmp/ge rm,rn 0011nnnnmmmm0011 if rn cmp/hi rm,rn 0011nnnnmmmm0110 if rn > rm with unsigned data, 1 cmp/gt rm,rn 0011nnnnmmmm0111 if rn > rm with signed data, 1 cmp/pl rn 0100nnnn00010101 if rn > 0, 1 cmp/pz rn 0100nnnn00010001 if rn cmp/str rm,rn 0010nnnnmmmm1100 if rn and rm have an equivalent byte, 1 div1 rm,rn 0011nnnnmmmm0100 single-step division (rn/rm) 1 calculation result div0s rm,rn 0010nnnnmmmm0111 msb of rn div0u 0000000000011001 0
section 2 cpu rev. 5.00 jan 06, 2006 page 43 of 818 rej09b0273-0500 instruction instruction code operation execu- tion cycles t bit dmuls.l rm,rn 0011nnnnmmmm1101 signed operation of rn * ? dmulu.l rm,rn 0011nnnnmmmm0101 unsigned operation of rn * ? dt rn 0100nnnn00010000 rn ? 1 exts.b rm,rn 0110nnnnmmmm1110 a byte in rm is sign- extended ? exts.w rm,rn 0110nnnnmmmm1111 a word in rm is sign- extended ? extu.b rm,rn 0110nnnnmmmm1100 a byte in rm is zero- extended ? extu.w rm,rn 0110nnnnmmmm1101 a word in rm is zero- extended ? mac.l @rm+,@rn+ 0000nnnnmmmm1111 signed operation of (rn) + * ? mac.w @rm+,@rn+ 0100nnnnmmmm1111 signed operation of (rn) * ? mul.l rm,rn 0000nnnnmmmm0111 rn * ? muls.w rm,rn 0010nnnnmmmm1111 signed operation of rn * ? mulu.w rm,rn 0010nnnnmmmm1110 unsigned operation of rn * ? neg rm,rn 0110nnnnmmmm1011 0 ? rm ? negc rm,rn 0110nnnnmmmm1010 0 ? rm ? t
section 2 cpu rev. 5.00 jan 06, 2006 page 44 of 818 rej09b0273-0500 instruction instruction code operation execu- tion cycles t bit sub rm,rn 0011nnnnmmmm1000 rn ? rm ? subc rm,rn 0011nnnnmmmm1010 rn ? rm ? t subv rm,rn 0011nnnnmmmm1011 rn ? rm * the normal minimum number of execution cycles. (the number in parentheses is the number of cycles when there is contention with following instructions.) table 2.14 logic operation instructions instruction instruction code operation execu- tion cycles t bit and rm,rn 0010nnnnmmmm1001 rn & rm ? and #imm,r0 11001001iiiiiiii r0 & imm ? and.b #imm,@(r0,gbr) 11001101iiiiiiii (r0 + gbr) & imm ? not rm,rn 0110nnnnmmmm0111 ~rm ? or rm,rn 0010nnnnmmmm1011 rn | rm ? or #imm,r0 11001011iiiiiiii r0 | imm ? or.b #imm,@(r0,gbr) 11001111iiiiiiii (r0 + gbr) | imm ? tas.b @rn 0100nnnn00011011 if (rn) is 0, 1 * 4test result tst rm,rn 0010nnnnmmmm1000 rn & rm; if the result is 0, 1 tst #imm,r0 11001000iiiiiiii r0 & imm; if the result is 0, 1 tst.b #imm,@(r0,gbr) 11001100iiiiiiii (r0 + gbr) & imm; if the result is 0, 1 xor rm,rn 0010nnnnmmmm1010 rn ^ rm ? xor #imm,r0 11001010iiiiiiii r0 ^ imm ? xor.b #imm,@(r0,gbr) 11001110iiiiiiii (r0 + gbr) ^ imm ? note: * the on-chip dmac bus cycles are not inserted between the read and write cycles of tas instruction execution. however, bus release due to breq is carried out.
section 2 cpu rev. 5.00 jan 06, 2006 page 45 of 818 rej09b0273-0500 table 2.15 shift instructions instruction instruction code operation execu- tion cycles t bit rotl rn 0100nnnn00000100 t rotr rn 0100nnnn00000101 lsb rotcl rn 0100nnnn00100100 t rotcr rn 0100nnnn00100101 t shal rn 0100nnnn00100000 t shar rn 0100nnnn00100001 msb shll rn 0100nnnn00000000 t shlr rn 0100nnnn00000001 0 shll2 rn 0100nnnn00001000 rn<<2 ? shlr2 rn 0100nnnn00001001 rn>>2 ? shll8 rn 0100nnnn00011000 rn<<8 ? shlr8 rn 0100nnnn00011001 rn>>8 ? shll16 rn 0100nnnn00101000 rn<<16 ? shlr16 rn 0100nnnn00101001 rn>>16 ?
section 2 cpu rev. 5.00 jan 06, 2006 page 46 of 818 rej09b0273-0500 table 2.16 branch instructions instruction instruction code operation exec. cycles t bit bf label 10001011dddddddd if t = 0, disp * ? bf/s label 10001111dddddddd delayed branch, if t = 0, disp * ? bt label 10001001dddddddd if t = 1, disp * ? bt/s label 10001101dddddddd delayed branch, if t = 1, disp * ? bra label 1010dddddddddddd delayed branch, disp ? braf rm 0000mmmm00100011 delayed branch, rm + pc ? bsr label 1011dddddddddddd delayed branch, pc ? bsrf rm 0000mmmm00000011 delayed branch, pc ? jmp @rm 0100mmmm00101011 delayed branch, rm ? jsr @rm 0100mmmm00001011 delayed branch, pc ? rts 0000000000001011 delayed branch, pr ? note: * one state when it does not branch.
section 2 cpu rev. 5.00 jan 06, 2006 page 47 of 818 rej09b0273-0500 table 2.17 system control instructions instruction instruction code operation exec. cycles t bit clrt 0000000000001000 0 clrmac 0000000000101000 0 ? ldc rm,sr 0100mmmm00001110 rm ldc rm,gbr 0100mmmm00011110 rm ? ldc rm,vbr 0100mmmm00101110 rm ? ldc.l @rm+,sr 0100mmmm00000111 (rm) ldc.l @rm+,gbr 0100mmmm00010111 (rm) ? ldc.l @rm+,vbr 0100mmmm00100111 (rm) ? lds rm,mach 0100mmmm00001010 rm ? lds rm,macl 0100mmmm00011010 rm ? lds rm,pr 0100mmmm00101010 rm ? lds.l @rm+,mach 0100mmmm00000110 (rm) ? lds.l @rm+,macl 0100mmmm00010110 (rm) ? lds.l @rm+,pr 0100mmmm00100110 (rm) ? nop 0000000000001001 no operation 1 ? rte 0000000000101011 delayed branch, stack area ? sett 0000000000011000 1 sleep 0000000000011011 sleep 3 * ? stc sr,rn 0000nnnn00000010 sr ? stc gbr,rn 0000nnnn00010010 gbr ? stc vbr,rn 0000nnnn00100010 vbr ? stc.l sr,@ ? rn 0100nnnn00000011 rn ? 4 ? stc.l gbr,@ ? rn 0100nnnn00010011 rn ? 4 ? stc.l vbr,@ ? rn 0100nnnn00100011 rn ? 4 ? sts mach,rn 0000nnnn00001010 mach ? sts macl,rn 0000nnnn00011010 macl ? sts pr,rn 0000nnnn00101010 pr ?
section 2 cpu rev. 5.00 jan 06, 2006 page 48 of 818 rej09b0273-0500 instruction instruction code operation exec. cycles t bit sts.l mach,@ ? rn 0100nnnn00000010 rn ? 4 ? sts.l macl,@ ? rn 0100nnnn00010010 rn ? 4 ? sts.l pr,@ ? rn 0100nnnn00100010 rn ? 4 ? trapa #imm 11000011iiiiiiii pc/sr ? note: * the number of execution cycles before the chip enters sleep mode: the execution cycles shown in the table are minimums. the actual number of cycles may be increased when (1) contention occurs between instruction fetches and data access, or (2) when the destination register of the load instruction (memory 2.5 processing states 2.5.1 state transitions the cpu has five processing states: reset, exception processing, bus release, program execution and power-down. figure 2.6 shows the transitions between the states.
section 2 cpu rev. 5.00 jan 06, 2006 page 49 of 818 rej09b0273-0500 power-on reset state sleep mode software standby mode hardware standby mode program execution state bus release state exception processing state res = 1 when an interrupt source or dma address error occurs nmi interrupt source occurs exception processing ends bus request generated exception processing source occurs bus request cleared bus request generated bus request cleared sby bit cleared for sleep instruction sby bit set for sleep instruction from any state when res = 0 res = 0 hstby = 1 power-down state from any state when res = 0 and hstby = 0 bus request generated bus request cleared figure 2.6 transitions between processing states
section 2 cpu rev. 5.00 jan 06, 2006 page 50 of 818 rej09b0273-0500 reset state: the cpu resets in the reset state. when the res pin level goes low, a power-on reset results. when the res pin is high and mres is low, a manual reset will occur. exception processing state : the exception processing state is a transient state that occurs when exception processing sources such as resets or interrupts alter the cpu ? s processing state flow. for a reset, the initial values of the program counter (pc) (execution start address) and stack pointer (sp) are fetched from the exception processing vector table and stored; the cpu then branches to the execution start address and execution of the program begins. for an interrupt, the stack pointer (sp) is accessed and the program counter (pc) and status register (sr) are saved to the stack area. the exception service routine start address is fetched from the exception processing vector table; the cpu then branches to that address and the program starts executing, thereby entering the program execution state. program execution state : in the program execution state, the cpu sequentially executes the program. power-down state : in the power-down state, the cpu operation halts and power consumption declines. the sleep instruction places the cpu in the sleep mode or the software standby mode. this state has two modes: sleep mode and standby mode. bus release state : in the bus release state, the cpu releases access rights to the bus to the device that has requested them.
section 3 operating modes rev. 5.00 jan 06, 2006 page 51 of 818 rej09b0273-0500 section 3 operating modes 3.1 operating mode selection the sh7050 series has five operating modes that are selected by pins md3 to md0 and fwe. the mode setting pins should not be changed during operation of the sh7050 series, and only the setting combinations shown in table 3.1 should be used. table 3.1 operating mode selection pin settings operating mode no. fwe md3 md2 md1 md0 mode name on-chip rom area 0 bus width mode 0 0 * * 0 0 mcu expanded mode disabled 8 bits mode 1 0 0 1 16 bits mode 2 0 1 0 enabled set by bcr1 mode 3 0 1 1 mcu single-chip mode enabled ? mode 16 1 0 0 boot mode enabled set by bcr1 mode 17 1 0 1 ? mode 18 1 1 0 user program mode enabled set by bcr1 mode 19 1 1 1 ? mode 13 0/1 1 1 0 1 writer mode note: * pins md3 and md2 set the clock operating mode. for details of the clock mode settings, see section 4.2, clock operating modes. there are two normal operating modes: single-chip mode and expanded mode. modes in which the flash memory can be programmed are boot mode and user program mode (the two on-board programming modes) and writer mode in which programming is performed with an eprom programmer (a type which supports programming of this device). for details, see the sections on rom.
section 3 operating modes rev. 5.00 jan 06, 2006 page 52 of 818 rej09b0273-0500
section 4 clock pulse generator (cpg) rev. 5.00 jan 06, 2006 page 53 of 818 rej09b0273-0500 section 4 clock pulse generator (cpg) 4.1 overview the clock pulse generator (cpg) supplies clock pulses inside the sh7050 series chip and to external devices. the sh7050 series cpg consists of an oscillator circuit and a pll multiplier circuit. there are two methods of generating a clock with the cpg: by connecting a crystal resonator, or by inputting an external clock. the oscillator circuit oscillates at the same frequency as the input clock. a chip operating frequency of 1, 2, or 4 times the oscillator frequency can be selected by means of the pll multiplier circuit. the cpg is halted in software standby mode and hardware standby mode.
section 4 clock pulse generator (cpg) rev. 5.00 jan 06, 2006 page 54 of 818 rej09b0273-0500 4.1.1 block diagram a block diagram of the clock pulse generator is shown in figure 4.1. pll multiplier circuit oscillator circuit multiplier circuit frequency divider circuit frequency divider circuit frequency division selection circuit cpg extal xtal pllv cc pllv ss pllcap md3 md2 ck (system clock) internal clock f 4 f 2 f 1 figure 4.1 block diagram of the clock pulse generator
section 4 clock pulse generator (cpg) rev. 5.00 jan 06, 2006 page 55 of 818 rej09b0273-0500 4.1.2 pin configuration the pins relating to the clock pulse generator are shown in table 4.1. table 4.1 cpg pins pin name abbreviation i/o description external clock extal input crystal resonator or external clock input crystal xtal input crystal resonator connection system clock ck output system clock output mode setting md3 input sets pll multiplication mode mode setting md2 input sets pll multiplication mode pll power supply pllv cc input pll multiplier circuit power supply pll ground pllv ss input pll multiplier circuit ground pll capacitance pllcap input pll multiplier circuit oscillation external capacitance pin 4.2 clock operating modes the clock operating mode is set with the md3 and md2 pins. clock mode selection is possible in operating modes 0 to 3 and 16 to 19. in this case, do not set both the md3 and md2 pin to 1. in programmer mode, the clock operating mode cannot be changed. the relationship between the mode pins and the clock operating mode is shown in table 4.2. table 4.2 clock operating mode settings clock mode md3 md2 input frequency range (mhz) pll multiplication factor operating frequency range (mhz) mode 0 0 0 4?10 1 4?10 mode 1 0 1 4?10 2 8?20 mode 2 1 0 4?5 4 16?20 note: crystal resonator and external clock input for the chip operating frequency, a frequency of 1, 2, or 4 times the input frequency can be selected as the internal clock by means of the on-chip pll circuit. the system clock (ck pin) output frequency is the same as that of the internal clock.
section 4 clock pulse generator (cpg) rev. 5.00 jan 06, 2006 page 56 of 818 rej09b0273-0500 the md3 and md2 pins should not be changed while the chip is operating, as normal operation will not be possible in this case. 4.3 clock source clock pulses can be supplied from a connected crystal resonator or an external clock. 4.3.1 connecting a crystal oscillator circuit configuration: figure 4.2 shows the example of connecting a crystal resonator. use the damping resistance (rd) shown in table 4.3. an at-cut parallel-resonance type crystal resonator should be used. load capacitors (cl1, cl2) must be connected as shown in the figure. the clock pulses generated by the crystal resonator and internal oscillator are sent to the pll multiplier circuit, where a multiplied frequency is selected and supplied inside the sh7050 chip and to external devices. the crystal manufacturer should be consulted concerning the compatibility between the crystal and the chip. xtal extal c l2 c l1 r d c l1 = c l2 = 18 e 22 pf (recommended value) figure 4.2 connection of the crystal oscillator (example) table 4.3 damping resistance values (recommended values) frequency (mhz) parameter 4 8 10 rd ( ? ) 500 200 0
section 4 clock pulse generator (cpg) rev. 5.00 jan 06, 2006 page 57 of 818 rej09b0273-0500 crystal oscillator: figure 4.3 shows an equivalent circuit of the crystal oscillator. use a crystal oscillator with the characteristics listed in table 4.4. c 0 extal c l lrs xtal figure 4.3 crystal oscillator equivalent circuit table 4.4 crystal oscillator parameters (recommended values) frequency (mhz) parameter 4 8 10 rs max ( ? ) 120 80 60 c0 max (pf) 7 7 7 4.3.2 external clock input method an example of external clock input connection is shown in figure 4.4. when the external clock is stopped in standby mode, ensure that it goes high. when the xtal pin is placed in the open state, the parasitic capacitance should be 10 pf or less. even when an external clock is input, provide for a wait of at least the oscillation settling time when powering on or exiting standby mode in order to secure the pll settling time. xtal extal open external clock input figure 4.4 external clock input method (example)
section 4 clock pulse generator (cpg) rev. 5.00 jan 06, 2006 page 58 of 818 rej09b0273-0500 4.4 notes on using notes on board design: when connecting a crystal oscillator, observe the following precautions: ? to prevent induction from interfering with correct oscillation, do not route any signal lines near the oscillator circuitry. ? when designing the board, place the crystal oscillator and its load capacitors as close as possible to the xtal and extal pins. figures 4.5 show the precautions regarding oscillator block board settings. crossing of signal lines prohibited c l1 xtal extal c l2 figure 4.5 cautions for oscillator circuit system board design pll oscillation power supply: place oscillation stabilization capacitor c1 and resistor r1 close to the pll and cap pin, and ensure that no other signal lines cross this line. supply the c1 ground from pllv ss . separate pllv cc and pllv ss from the other v cc and v ss lines at the board power supply source, and be sure to insert bypass capacitors c pb and c b close to the pins.
section 4 clock pulse generator (cpg) rev. 5.00 jan 06, 2006 page 59 of 818 rej09b0273-0500 pllcap pllv cc pllv ss v cc v ss recommended values c pb , c b : 0.1 f rp: 200 ? r1: 3 k ? c1: 470 pf (laminated ceramic) r1 c pb c b rp c1 figure 4.6 points for caution in pll power supply connection pllv ss pllcap extal xtal pllv cc md3 v ss figure 4.7 actual example of board design
section 4 clock pulse generator (cpg) rev. 5.00 jan 06, 2006 page 60 of 818 rej09b0273-0500
section 5 exception processing rev. 5.00 jan 06, 2006 page 61 of 818 rej09b0273-0500 section 5 exception processing 5.1 overview 5.1.1 types of exception processing and priority exception processing is started by four sources: resets, address errors, interrupts and instructions and have the priority shown in table 5.1. when several exception processing sources occur at once, they are processed according to the priority shown. table 5.1 types of exception processing and priority order exception source priority reset power-on reset high cpu address error address error dmac address error interrupt nmi user break irq on-chip peripheral modules: ? direct memory access controller (dmac) ? advanced timer unit (atu) ? compare match timer (cmt) ? a/d converter (a/d) ? serial communications interface (sci) ? watchdog timer (wdt) instructions trap instruction (trapa instruction) general illegal instructions (undefined code) illegal slot instructions (undefined code placed directly after a delay branch instruction * 1 or instructions that rewrite the pc * 2 ) low notes: 1. delayed branch instructions: jmp, jsr, bra, bsr, rts, rte, bf/s, bt/s, bsrf, braf. 2. instructions that rewrite the pc: jmp, jsr, bra, bsr, rts, rte, bt, bf, trapa, bf/s, bt/s, bsrf, braf.
section 5 exception processing rev. 5.00 jan 06, 2006 page 62 of 818 rej09b0273-0500 5.1.2 exception processing operations the exception processing sources are detected and begin processing according to the timing shown in table 5.2. table 5.2 timing of exception source detection and the start of exception processing exception source timing of source detection and start of processing reset power-on reset starts when the res pin changes from low to high. address error detected when instruction is decoded and starts when the previous executing instruction finishes executing. interrupts detected when instruction is decoded and starts when the previous executing instruction finishes executing. instructions trap instruction starts from the execution of a trapa instruction. general illegal instructions starts from the decoding of undefined code anytime except after a delayed branch instruction (delay slot). illegal slot instructions starts from the decoding of undefined code placed in a delayed branch instruction (delay slot) or of instructions that rewrite the pc. when exception processing starts, the cpu operates as follows: 1. exception processing triggered by reset: the initial values of the program counter (pc) and stack pointer (sp) are fetched from the exception processing vector table (pc and sp are respectively the h'00000000 and h'00000004 addresses for power-on resets and the h'00000008 and h'0000000c addresses for manual resets). see section 5.1.3, exception processing vector table, for more information. 0 is then written to the vector base register (vbr) and 1111 is written to the interrupt mask bits (i3?i0) of the status register (sr). the program begins running from the pc address fetched from the exception processing vector table. 2. exception processing triggered by address errors, interrupts and instructions: sr and pc are saved to the stack indicated by r15. for interrupt exception processing, the interrupt priority level is written to the sr?s interrupt mask bits (i3?i0). for address error and instruction exception processing, the i3?i0 bits are not affected. the start address is then fetched from the exception processing vector table and the program begins running from that address.
section 5 exception processing rev. 5.00 jan 06, 2006 page 63 of 818 rej09b0273-0500 5.1.3 exception processing vector table before exception processing begins running, the exception processing vector table must be set in memory. the exception processing vector table stores the start addresses of exception service routines. (the reset exception processing table holds the initial values of pc and sp.) all exception sources are given different vector numbers and vector table address offsets, from which the vector table addresses are calculated. during exception processing, the start addresses of the exception service routines are fetched from the exception processing vector table, which indicated by this vector table address. table 5.3 shows the vector numbers and vector table address offsets. table 5.4 shows how vector table addresses are calculated. table 5.3 exception processing vector table exception sources vector numbers vector table address offset power-on reset pc 0 h'00000000?h'00000003 sp 1 h'00000004?h'00000007 (reserved by system) 2 h'00000008?h'0000000b (reserved by system) 3 h'0000000c?h'0000000f general illegal instruction 4 h'00000010?h'00000013 (reserved by system) 5 h'00000014?h'00000017 slot illegal instruction 6 h'00000018?h'0000001b (reserved by system) 7 h'0000001c?h'0000001f (reserved by system) 8 h'00000020?h'00000023 cpu address error 9 h'00000024?h'00000027 dmac address error 10 h'00000028?h'0000002b interrupts nmi 11 h'0000002c?h'0000002f user break 12 h'00000030?h'00000033 (reserved by system) 13 : 31 h'00000034?h'00000037 : h'0000007c?h'0000007f trap instruction (user vector) 32 : 63 h'00000080?h'00000083 : h'000000fc?h'000000ff
section 5 exception processing rev. 5.00 jan 06, 2006 page 64 of 818 rej09b0273-0500 exception sources vector numbers vector table address offset interrupts irq0 64 h'00000100?h'00000103 irq1 65 h'00000104?h'00000107 irq2 66 h'00000108?h'0000010b irq3 67 h'0000010c?h'0000010f irq4 68 h'00000110?h'00000113 irq5 69 h'00000114?h'00000117 irq6 70 h'00000118?h'0000011b irq7 71 h'0000011c?h'0000011f on-chip peripheral module * 72 : 255 h'00000120?h'00000124 : h'000003fc?h'000003ff note: * the vector numbers and vector table address offsets for each on-chip peripheral module interrupt are given in section 6, interrupt controller, and table 6.3, interrupt exception processing vectors and priorities. table 5.4 calculating exception processing vector table addresses exception source vector table address calculation resets vector table address = (vector table address offset) = (vector number) 4 address errors, interrupts, instructions vector table address = vbr + (vector table address offset) = vbr + (vector number) 4 notes: 1. vbr: vector base register 2. vector table address offset: see table 5.3. 3. vector number: see table 5.3.
section 5 exception processing rev. 5.00 jan 06, 2006 page 65 of 818 rej09b0273-0500 5.2 resets 5.2.1 power-on reset when the res pin is driven low, the lsi does a power-on reset. to reliably reset the lsi, the res pin should be kept at low for at least the duration of the oscillation settling time when applying power or when in standby mode (when the clock circuit is halted) or at least 20 t cyc (when the clock circuit is running). during power-on reset, cpu internal status and all registers of on-chip peripheral modules are initialized. see appendix b, pin status, for the status of individual pins during the power-on reset status. in the power-on reset status, power-on reset exception processing starts when the res pin is first driven low for a set period of time and then returned to high. the cpu will then operate as follows: 1. the initial value (execution start address) of the program counter (pc) is fetched from the exception processing vector table. 2. the initial value of the stack pointer (sp) is fetched from the exception processing vector table. 3. the vector base register (vbr) is cleared to h'00000000 and the interrupt mask bits (i3?i0) of the status register (sr) are set to h'f (1111). 4. the values fetched from the exception processing vector table are set in the program counter (pc) and sp and the program begins executing. be certain to always perform power-on reset processing when turning the system power on.
section 5 exception processing rev. 5.00 jan 06, 2006 page 66 of 818 rej09b0273-0500 5.3 address errors 5.3.1 address error sources address errors occur when instructions are fetched or data read or written, as shown in table 5.5. table 5.5 bus cycles and address errors bus cycle type bus master bus cycle description address errors instruction fetched from even address none (normal) instruction fetch cpu instruction fetched from odd address address error occurs instruction fetched from other than on-chip peripheral module space * none (normal) instruction fetched from on-chip peripheral module space * address error occurs instruction fetched from external memory space when in single chip mode address error occurs word data accessed from even address none (normal) data read/write cpu or dmac word data accessed from odd address address error occurs longword data accessed from a longword boundary none (normal) longword data accessed from other than a long-word boundary address error occurs byte or word data accessed in on-chip peripheral module space * none (normal) longword data accessed in 16-bit on-chip peripheral module space * none (normal) longword data accessed in 8-bit on-chip peripheral module space * address error occurs external memory space accessed when in single chip mode address error occurs note: * see section 8, bus state controller.
section 5 exception processing rev. 5.00 jan 06, 2006 page 67 of 818 rej09b0273-0500 5.3.2 address error exception processing when an address error occurs, the bus cycle in which the address error occurred ends. when the executing instruction then finishes, address error exception processing starts up. the cpu operates as follows: 1. the status register (sr) is saved to the stack. 2. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the last executed instruction. 3. the exception service routine start address is fetched from the exception processing vector table that corresponds to the address error that occurred and the program starts executing from that address. the jump that occurs is not a delayed branch. 5.4 interrupts 5.4.1 interrupt sources table 5.6 shows the sources that start up interrupt exception processing. these are divided into nmi, user breaks, irq and on-chip peripheral modules. table 5.6 interrupt sources type request source number of sources nmi nmi pin (external input) 1 user break user break controller 1 irq irq0 ? irq7 (external input) 8 on-chip peripheral module direct memory access controller (dmac) 4 advanced timer unit (atu) 44 compare match timer (cmt) 2 a/d converter 2 serial communications interface (sci) 12 watchdog timer (wdt) 1 each interrupt source is allocated a different vector number and vector table offset. see section 6, interrupt controller, and table 6.3, interrupt exception processing vectors and priorities, for more information on vector numbers and vector table address offsets.
section 5 exception processing rev. 5.00 jan 06, 2006 page 68 of 818 rej09b0273-0500 5.4.2 interrupt priority level the interrupt priority order is predetermined. when multiple interrupts occur simultaneously (overlap), the interrupt controller (intc) determines their relative priorities and starts up processing according to the results. the priority order of interrupts is expressed as priority levels 0?16, with priority 0 the lowest and priority 16 the highest. the nmi interrupt has priority 16 and cannot be masked, so it is always accepted. the user break interrupt priority level is 15. irq interrupts and on-chip peripheral module interrupt priority levels can be set freely using the intc?s interrupt priority level setting registers a through h (ipra to iprh) as shown in table 5.7. the priority levels that can be set are 0?15. level 16 cannot be set. table 5.7 interrupt priority order type priority level comment nmi 16 fixed priority level. cannot be masked. user break 15 fixed priority level. irq 0?15 set with interrupt priority level setting registers a through h (ipra to iprh). on-chip peripheral module 0?15 set with interrupt priority level setting registers a through h (ipra to iprh). 5.4.3 interrupt exception processing when an interrupt occurs, its priority level is ascertained by the interrupt controller (intc). nmi is always accepted, but other interrupts are only accepted if they have a priority level higher than the priority level set in the interrupt mask bits (i3?i0) of the status register (sr). when an interrupt is accepted, exception processing begins. in interrupt exception processing, the cpu saves sr and the program counter (pc) to the stack. the priority level value of the accepted interrupt is written to sr bits i3?i0. for nmi, however, the priority level is 16, but the value set in i3?i0 is h'f (level 15). next, the start address of the exception service routine is fetched from the exception processing vector table for the accepted interrupt, that address is jumped to and execution begins.
section 5 exception processing rev. 5.00 jan 06, 2006 page 69 of 818 rej09b0273-0500 5.5 exceptions triggered by instructions 5.5.1 types of exceptions triggered by instructions exception processing can be triggered by trap instructions, general illegal instructions, and illegal slot instructions, as shown in table 5.8. table 5.8 types of exceptions triggered by instructions type source instruction comment trap instructions trapa ? illegal slot instructions undefined code placed immediately after a delayed branch instruction (delay slot) and instructions that rewrite the pc delayed branch instructions: jmp, jsr, bra, bsr, rts, rte, bf/s, bt/s, bsrf, braf instructions that rewrite the pc: jmp, jsr, bra, bsr, rts, rte, bt, bf, trapa, bf/s, bt/s, bsrf, braf general illegal instructions undefined code anywhere besides in a delay slot ? 5.5.2 trap instructions when a trapa instruction is executed, trap instruction exception processing starts up. the cpu operates as follows: 1. the status register (sr) is saved to the stack. 2. the program counter (pc) is saved to the stack. the pc value saved is the start address of the instruction to be executed after the trapa instruction. 3. the exception service routine start address is fetched from the exception processing vector table that corresponds to the vector number specified in the trapa instruction. that address is jumped to and the program starts executing. the jump that occurs is not a delayed branch.
section 5 exception processing rev. 5.00 jan 06, 2006 page 70 of 818 rej09b0273-0500 5.5.3 illegal slot instructions an instruction placed immediately after a delayed branch instruction is said to be placed in a delay slot. when the instruction placed in the delay slot is undefined code, illegal slot exception processing starts up when that undefined code is decoded. illegal slot exception processing also starts up when an instruction that rewrites the program counter (pc) is placed in a delay slot. the processing starts when the instruction is decoded. the cpu handles an illegal slot instruction as follows: 1. the status register (sr) is saved to the stack. 2. the program counter (pc) is saved to the stack. the pc value saved is the jump address of the delayed branch instruction immediately before the undefined code or the instruction that rewrites the pc. 3. the exception service routine start address is fetched from the exception processing vector table that corresponds to the exception that occurred. that address is jumped to and the program starts executing. the jump that occurs is not a delayed branch. 5.5.4 general illegal instructions when undefined code placed anywhere other than immediately after a delayed branch instruction (i.e., in a delay slot) is decoded, general illegal instruction exception processing starts up. the cpu handles general illegal instructions the same as illegal slot instructions. unlike processing of illegal slot instructions, however, the program counter value stored is the start address of the undefined code.
section 5 exception processing rev. 5.00 jan 06, 2006 page 71 of 818 rej09b0273-0500 5.6 when exception sources are not accepted when an address error or interrupt is generated after a delayed branch instruction or interrupt- disabled instruction, it is sometimes not accepted immediately but stored instead, as shown in table 5.9. when this happens, it will be accepted when an instruction that can accept the exception is decoded. table 5.9 generation of exception sources immediately after a delayed branch instruction or interrupt-disabled instruction exception source point of occurrence address error interrupt immediately after a delayed branch instruction * 1 not accepted not accepted immediately after an interrupt-disabled instruction * 2 accepted not accepted notes: 1. delayed branch instructions: jmp, jsr, bra, bsr, rts, rte, bf/s, bt/s, bsrf, braf 2. interrupt-disabled instructions: ldc, ldc.l, stc, stc.l, lds, lds.l, sts, sts.l 5.6.1 immediately after a delayed branch instruction when an instruction placed immediately after a delayed branch instruction (delay slot) is decoded, neither address errors nor interrupts are accepted. the delayed branch instruction and the instruction located immediately after it (delay slot) are always executed consecutively, so no exception processing occurs during this period. 5.6.2 immediately after an interrupt-disabled instruction when an instruction immediately following an interrupt-disabled instruction is decoded, interrupts are not accepted. address errors are accepted.
section 5 exception processing rev. 5.00 jan 06, 2006 page 72 of 818 rej09b0273-0500 5.7 stack status after exception processing ends the status of the stack after exception processing ends is as shown in table 5.10. table 5.10 types of stack status after exception processing ends types stack status address error 32 bits 32 bits sr address of instruction after executed instruction sp trap instruction 32 bits 32 bits sr address of instruction after trapa instruction sp general illegal instruction 32 bits 32 bits sr start address of illegal instruction sp interrupt 32 bits 32 bits sr address of instruction after executed instruction sp illegal slot instruction 32 bits 32 bits sr jump destination address of delay branch instruction sp
section 5 exception processing rev. 5.00 jan 06, 2006 page 73 of 818 rej09b0273-0500 5.8 notes on use 5.8.1 value of stack pointer (sp) the value of the stack pointer must always be a multiple of four. if it is not, an address error will occur when the stack is accessed during exception processing. 5.8.2 value of vector base register (vbr) the value of the vector base register must always be a multiple of four. if it is not, an address error will occur when the stack is accessed during exception processing. 5.8.3 address errors caused by stacking of address error exception processing when the stack pointer is not a multiple of four, an address error will occur during stacking of the exception processing (interrupts, etc.) and address error exception processing will start up as soon as the first exception processing is ended. address errors will then also occur in the stacking for this address error exception processing. to ensure that address error exception processing does not go into an endless loop, no address errors are accepted at that point. this allows program control to be shifted to the address error exception service routine and enables error processing. when an address error occurs during exception processing stacking, the stacking bus cycle (write) is executed. during stacking of the status register (sr) and program counter (pc), the sp is ?4 for both, so the value of sp will not be a multiple of four after the stacking either. the address value output during stacking is the sp value, so the address where the error occurred is itself output. this means the write data stacked will be undefined.
section 5 exception processing rev. 5.00 jan 06, 2006 page 74 of 818 rej09b0273-0500
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 75 of 818 rej09b0273-0500 section 6 interrupt controller (intc) 6.1 overview the interrupt controller (intc) ascertains the priority of interrupt sources and controls interrupt requests to the cpu. the intc has registers for setting the priority of each interrupt which can be used by the user to order the priorities in which the interrupt requests are processed. 6.1.1 features the intc has the following features: ? 16 levels of interrupt priority: by setting the eight interrupt-priority level registers, the priorities of irq interrupts and on-chip peripheral module interrupts can be set in 16 levels for different request sources. ? nmi noise canceler function: nmi input level bits indicate the nmi pin status. by reading these bits with the interrupt exception service routine, the pin status can be confirmed, enabling it to be used as a noise canceler. ? notification of interrupt occurrence can be reported externally ( irqout pin). for example, it is possible to request bus rights if an external bus master is informed that a peripheral module interrupt has occurred when the lsi has released the bus rights.
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 76 of 818 rej09b0273-0500 6.1.2 block diagram figure 6.1 is a block diagram of the intc. cpu sr interrupt request com- parator cpu/ dmac request judg- ment priority ranking judg- ment input control (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) isr icr ipr dter dtc ipra?iprh module bus bus interface internal bus i3 i2 i1 i0 intc irqout nmi irq0 irq1 irq2 irq3 irq4 irq5 irq6 irq7 ubc dmac atu cmt sci a/d (interrupt request) wdt ubc: dmac: cmt: sci: a/d: wdt: user break controller direct memory access controller compare match timer serial communication interface a/d converter watchdog timer icr: isr: dter: ipra?iprh: sr: interrupt control register irq ststus register dtc enable register interrupt priority level setting registers a to h status register figure 6.1 intc block diagram
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 77 of 818 rej09b0273-0500 6.1.3 pin configuration table 6.1 shows the intc pin configuration. table 6.1 pin configuration name abbreviation i/o function non-maskable interrupt input pin nmi i input of non-maskable interrupt request signal interrupt request input pins irq0 ? irq7 i input of maskable interrupt request signals interrupt request output pin irqout o output of notification signal when an interrupt has occurred 6.1.4 register configuration the intc has the 10 registers shown in table 6.2. these registers set the priority of the interrupts and control external interrupt input signal detection. table 6.2 register configuration name abbr. r/w initial value address access sizes interrupt priority register a ipra r/w h'0000 h'ffff8348 8, 16, 32 interrupt priority register b iprb r/w h'0000 h'ffff834a 8, 16, 32 interrupt priority register c iprc r/w h'0000 h'ffff834c 8, 16, 32 interrupt priority register d iprd r/w h'0000 h'ffff834e 8, 16, 32 interrupt priority register e ipre r/w h'0000 h'ffff8350 8, 16, 32 interrupt priority register f iprf r/w h'0000 h'ffff8352 8, 16, 32 interrupt priority register g iprg r/w h'0000 h'ffff8354 8, 16, 32 interrupt priority register h iprh r/w h'0000 h'ffff8356 8, 16, 32 interrupt control register icr r/w * 1 h'ffff8358 8, 16, 32 irq status register isr r(w) * 2 h'0000 h'ffff835a 8, 16, 32 notes: two access cycles are required for byte access and word access, and four cycles for longword access. 1. the value when the nmi pin is high is h'8000; when the nmi pin is low, it is h'0000. 2. only 0 can be written, in order to clear flags.
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 78 of 818 rej09b0273-0500 6.2 interrupt sources there are four types of interrupt sources: nmi, user breaks, irq, and on-chip peripheral modules. each interrupt has a priority expressed as a priority level (0 to 16, with 0 the lowest and 16 the highest). giving an interrupt a priority level of 0 masks it. 6.2.1 nmi interrupts the nmi interrupt has priority 16 and is always accepted. input at the nmi pin is detected by edge. use the nmi edge select bit (nmie) in the interrupt control register (icr) to select either the rising or falling edge. nmi interrupt exception processing sets the interrupt mask level bits (i3?i0) in the status register (sr) to level 15. 6.2.2 user break interrupt a user break interrupt has a priority of level 15, and occurs when the break condition set in the user break controller (ubc) is satisfied. user break interrupt requests are detected by edge and are held until accepted. user break interrupt exception processing sets the interrupt mask level bits (i3?i0) in the status register (sr) to level 15. for more information about the user break interrupt, see section 7, user break controller. 6.2.3 irq interrupts irq interrupts are requested by input from pins irq0 ? irq7 . set the irq sense select bits (irq0s?irq7s) of the interrupt control register (icr) to select low level detection or falling edge detection for each pin. the priority level can be set from 0 to 15 for each pin using the interrupt priority registers a and b (ipra?iprb). when irq interrupts are set to low level detection, an interrupt request signal is sent to the intc during the period the irq pin is low level. interrupt request signals are not sent to the intc when the irq pin becomes high level. interrupt request levels can be confirmed by reading the irq flags (irq0f?irq7f) of the irq status register (isr). when irq interrupts are set to falling edge detection, interrupt request signals are sent to the intc upon detecting a change on the irq pin from high to low level. irq interrupt request detection results are maintained until the interrupt request is accepted. confirmation that irq interrupt requests have been detected is possible by reading the irq flags (irq0f?irq7f) of the irq status register (isr), and by writing a 0 after reading a 1, irq interrupt request detection results can be withdrawn.
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 79 of 818 rej09b0273-0500 in irq interrupt exception processing, the interrupt mask bits (i3?i0) of the status register (sr) are set to the priority level value of the accepted irq interrupt. 6.2.4 on-chip peripheral module interrupts on-chip peripheral module interrupts are interrupts generated by the following on-chip peripheral modules: ? direct memory access controller (dmac) ? advanced timer unit (atu) ? compare match timer (cmt) ? a/d converter (a/d) ? serial communications interface (sci) ? watchdog timer (wdt) a different interrupt vector is assigned to each interrupt source, so the exception service routine does not have to decide which interrupt has occurred. priority levels between 0 and 15 can be assigned to individual on-chip peripheral modules in interrupt priority registers c?h (iprc? iprh). on-chip peripheral module interrupt exception processing sets the interrupt mask level bits (i3?i0) in the status register (sr) to the priority level value of the on-chip peripheral module interrupt that was accepted. 6.2.5 interrupt exception vectors and priority rankings table 6.3 lists interrupt sources and their vector numbers, vector table address offsets and interrupt priorities. each interrupt source is allocated a different vector number and vector table address offset. vector table addresses are calculated from vector numbers and address offsets. in interrupt exception processing, the exception service routine start address is fetched from the vector table indicated by the vector table address. see table 5.4, calculating exception processing vector table addresses. irq interrupts and on-chip peripheral module interrupt priorities can be set freely between 0 and 15 for each pin or module by setting interrupt priority registers a?h (ipra?iprh). the ranking of interrupt sources for iprc?iprh, however, must be the order listed under priority within ipr setting range in table 6.3 and cannot be changed. a power-on reset assigns priority level 0 to irq interrupts and on-chip peripheral module interrupts. if the same priority level is assigned to two or
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 80 of 818 rej09b0273-0500 more interrupt sources and interrupts from those sources occur simultaneously, their priority order is the default priority order indicated at the right in table 6.3. table 6.3 interrupt exception processing vectors and priorities interrupt vector interrupt source vector no. vector table address offset interrupt priority (initial value) corre- sponding ipr (bits) priority within ipr setting range default priority nmi 11 h'0000002c to h'0000002f 16 ? ? high user break 12 h'00000030 to h'00000033 15 ? ? irq0 64 h'00000100 to h'00000103 0 to 15 (0) ipra (15?12) ? irq1 65 h'00000104 to h'00000107 0 to 15 (0) ipra (11?8) ? irq2 66 h'00000108 to h'0000010b 0 to 15 (0) ipra (7?4) ? irq3 67 h'0000010c to h'0000010f 0 to 15 (0) ipra (3?0) ? irq4 68 h'00000110 to h'00000113 0 to 15 (0) iprb (15?12) ? irq5 69 h'00000114 to h'00000117 0 to 15 (0) iprb (11?8) ? irq6 70 h'00000118 to h'0000011b 0 to 15 (0) iprb (7?4) ? irq7 71 h'0000011c to h'0000011f 0 to 15 (0) iprb (3?0) ? dmac0 dei0 72 h'00000120 to h'00000123 0 to 15 (0) iprc (15?12) dmac1 dei1 74 h'00000128 to h'0000012b 0 to 15 (0) high low dmac2 dei2 76 h'00000130 to h'00000133 0 to 15 (0) iprc (11?8) dmac3 dei3 78 h'00000138 to h'0000013b 0 to 15 (0) high low low
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 81 of 818 rej09b0273-0500 interrupt vector interrupt source vector no. vector table address offset interrupt priority (initial value) corre- sponding ipr (bits) priority within ipr setting range default priority atu0 atu01 itv 80 h'00000140 to h'00000143 0 to 15 (0) iprc (7?4) ?high atu02 ici0a 84 h'00000150 to h'00000153 0 to 15 (0) iprc (3?0) 1 ici0b 85 h'00000154 to h'00000157 2 ici0c 86 h'00000158 to h'0000015b 3 ici0d 87 h'0000015c to h'0000015f 4 atu03 ovio 88 h'00000160 to h'00000163 0 to 15 (0) iprd (15?12) ? atu1 atu11 imi1a 92 h'00000170 to h'00000173 0 to 15 (0) iprd (11?8) 1 imi1b 93 h'00000174 to h'00000177 2 imi1c 94 h'00000178 to h'0000017b 3 atu12 imi1d 96 h'0000180 to h'00000183 0 to 15 (0) iprd (7?4) 1 imi1e 97 h'00000184 to h'00000187 2 imi1f 98 h'00000188 to h'0000018b 3 atu13 ov11 100 h'00000190 to h'00000193 0 to 15 (0) iprd (3?0) ? atu2 imi2a 104 h'000001a0 to h'000001a3 0 to 15 (0) ipre (15?12) 1 imi2b 105 h'000001a4 to h'000001a7 2 ov12 106 h'000001a8 to h'000001ab 3 low
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 82 of 818 rej09b0273-0500 interrupt vector interrupt source vector no. vector table address offset interrupt priority (initial value) corre- sponding ipr (bits) priority within ipr setting range default priority atu3 atu31 imi3a 108 h'000001b0 to h'000001b3 0 to 15 (0) ipre (11?8) 1high imi3b 109 h'000001b4 to h'000001b7 2 imi3c 110 h'000001b8 to h'000001bb 3 imi3d 111 h'000001bc to h'000001bf 4 atu32 ov13 112 h'000001c0 to h'000001c3 0 to 15 (0) ipre (7?4) ? atu4 atu41 imi4a 116 h'000001d0 to h'000001d3 0 to 15 (0) ipre (3?0) 1 imi4b 117 h'000001d4 to h'000001d7 2 imi4c 118 h'000001d8 to h'000001db 3 imi4d 119 h'000001dc to h'000001df 4 atu42 ov14 120 h'000001e0 to h'000001e3 0 to 15 (0) iprf (15?12) ? atu5 imi5a 124 h'000001f0 to h'000001f3 0 to 15 (0) iprf (11?8) 1 imi5b 125 h'000001f4 to h'000001f7 2 ov15 126 h'000001f8 to h'000001fb 3 atu6 cmi6 128 h'00000200 to h'00000203 0 to 15 (0) iprf (7?4) 1 atu7 cmi7 129 h'00000204 to h'00000207 2 atu8 cmi8 130 h'00000208 to h'0000020b 3 atu9 cmi9 131 h'0000020c to h'0000020f 4 low
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 83 of 818 rej09b0273-0500 interrupt vector interrupt source vector no. vector table address offset interrupt priority (initial value) corre- sponding ipr (bits) priority within ipr setting range default priority atu10 atu101 osi10a 132 h'00000210 to h'00000213 0 to 15 (0) iprf (3?0) 1high osi10b 133 h'00000214 to h'00000217 2 osi10c 134 h'00000218 to h'0000021b 3 atu102 osi10d 136 h'00000220 to h'00000223 0 to 15 (0) iprg (15?12) 1 osi10e 137 h'00000224 to h'00000227 2 osi10f 138 h'00000228 to h'0000022b 3 atu103 osi10g 140 h'00000230 to h'00000233 0 to 15 (0) iprg (11?8) 1 osi10h 141 h'00000234 to h'00000237 2 cmt0 cmti0 144 h'00000240 to h'00000243 0 to 15 (0) iprg (7?4) 1 a/d0 adi0 145 h'00000244 to h'00000247 2 cmt1 cmt11 148 h'00000250 to h'00000253 0 to 15 (0) iprg (3?0) 1 a/d1 adi1 149 h'00000254 to h'00000257 2 sci0 eri0 152 h'00000260 to h'00000263 0 to 15 (0) iprh (15?12) 1 rxi0 153 h'00000264 to h'00000267 2 txi0 154 h'00000268 to h'0000026b 3 tei0 155 h'0000026c to h'0000026f 4 low
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 84 of 818 rej09b0273-0500 interrupt vector interrupt source vector no. vector table address offset interrupt priority (initial value) corre- sponding ipr (bits) priority within ipr setting range default priority sci1 eri1 156 h'00000270 to h'00000273 0 to 15 (0) iprh (11?8) 1high rxi1 157 h'00000274 to h'00000277 2 txi1 158 h'00000278 to h'0000027b 3 tei1 159 h'0000027c to h'0000027f 4 sci2 eri2 160 h'00000280 to h'00000283 0 to 15 (0) iprh (7?4) 1 rxi2 161 h'00000284 to h'00000287 2 txi2 162 h'00000288 to h'0000028b 3 tei2 163 h'0000028c to h'0000028f 4 wdt iti 164 h'00000290 to h'00000293 0 to 15 (0) iprh (3?0) ? low 6.3 description of registers 6.3.1 interrupt priority registers a?h (ipra?iprh) interrupt priority registers a?h (ipra?iprh) are 16-bit readable/writable registers that set priority levels from 0 to 15 for irq interrupts and on-chip peripheral module interrupts. correspondence between interrupt request sources and each of the ipra?iprh bits is shown in table 6.4.
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 85 of 818 rej09b0273-0500 bit: 15 14 13 12 11 10 9 8 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table 6.4 interrupt request sources and ipra?iprh bits register 15?12 11?8 7?4 3?0 interrupt priority register a irq0 irq1 irq2 irq3 interrupt priority register b irq4 irq5 irq6 irq7 interrupt priority register c dmac0, 1 dmac2, 3 atu01 atu02 interrupt priority register d atu03 atu11 atu12 atu13 interrupt priority register e atu2 atu31 atu32 atu41 interrupt priority register f atu42 atu5 atu6?9 atu101 interrupt priority register g atu102 atu103 cmt0, a/d0 cmt1, a/d1 interrupt priority register h sci0 sci1 sci2 wdt as indicated in table 6.4, four irq pins or groups of 4 on-chip peripheral modules are allocated to each register. each of the corresponding interrupt priority ranks are established by setting a value from h'0 (0000) to h'f (1111) in each of the four-bit groups 15?12, 11?8, 7?4 and 3?0. interrupt priority rank becomes level 0 (lowest) by setting h'0, and level 15 (highest) by setting h'f. if multiple on-chip peripheral modules are assigned to same bit (dmac0 and dmac1, dmac2 and dmac3, atu6 to atu9, cmt0 and a/d0, and cmt1 and a/d1), those multiple modules are set to the same priority rank. ipra?iprh are initialized to h'0000 by a power-on reset. they are not initialized in standby mode.
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 86 of 818 rej09b0273-0500 6.3.2 interrupt control register (icr) the icr is a 16-bit register that sets the input signal detection mode of the external interrupt input pin nmi and irq0 ? irq7 and indicates the input signal level to the nmi pin. a power-on reset and hardware standby mode initialize icr but the software standby mode does not. bit: 15 14 13 12 11 10 9 8 nmil??????nmie initial value: * 0000000 r/w:rrrrrrrr/w bit:76543210 irq0s irq1s irq2s irq3s irq4s irq5s irq6s irq7s initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w note: * when nmi input is high: 1; when nmi input is low: 0 bit 15?nmi input level (nmil): sets the level of the signal input at the nmi pin. this bit can be read to determine the nmi pin level. this bit cannot be modified. bit 15: nmil description 0 nmi input level is low 1 nmi input level is high bits 14 to 9?reserved: these bits always read as 0. the write value should always be 0. bit 8?nmi edge select (nmie) bit 8: nmie description 0 interrupt request is detected on falling edge of nmi input (initial value) 1 interrupt request is detected on rising edge of nmi input
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 87 of 818 rej09b0273-0500 bits 7 to 0?irq0?irq7 sense select (irq0s?irq7s): these bits set the irq0?irq7 interrupt request detection mode. bits 7-0: irq0s?irq7s description 0 interrupt request is detected on low level of irq input (initial value) 1 interrupt request is detected on falling edge of irq input 6.3.3 irq status register (isr) the isr is a 16-bit register that indicates the interrupt request status of the external interrupt input pins irq0 ? irq7 . when irq interrupts are set to edge detection, held interrupt requests can be withdrawn by writing a 0 to irqnf after reading an irqnf = 1. a power-on reset initializes isr but the standby mode does not. bit: 15 14 13 12 11 10 9 8 ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 irq0f irq1f irq2f irq3f irq4f irq5f irq6f irq7f initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bits 15 to 8?reserved: these bits always read as 0. the write value should always be 0.
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 88 of 818 rej09b0273-0500 bits 7 to 0?irq0?irq7 flags (irq0f?irq7f): these bits display the irq0?irq7 interrupt request status. bits 7-0: irq0f?irq7f detection setting description 0 level detection no irqn interrupt request exists. clear conditions: when irqn input is high level edge detection no irqn interrupt request was detected. (initial value) clear conditions: 1. when a 0 is written after reading irqnf = 1 status 2. when irqn interrupt exception processing has been executed 1 level detection an irqn interrupt request exists. set conditions: when irqn input is low level edge detection an irqn interrupt request was detected. set conditions: when a falling edge occurs at an irqn input irq pin resirqn (irqn interrupt reception/writing a 0 to irqnf after reading an irqnf = 1) s cpu interrupt request isr.irqnf irqns (0: level, 1: edge) r q level detection selector edge detection figure 6.2 irq0 ? irq7 interrupt control
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 89 of 818 rej09b0273-0500 6.4 interrupt operation 6.4.1 interrupt sequence the sequence of interrupt operations is explained below. figure 6.3 is a flowchart of the operations. 1. the interrupt request sources send interrupt request signals to the interrupt controller. 2. the interrupt controller selects the highest priority interrupt in the interrupt requests sent, following the priority levels set in interrupt priority level setting registers a?h (ipra?iprh). lower-priority interrupts are ignored. they are held pending until interrupt requests designated as edge-detect type are accepted. for irq interrupts, however, withdrawal is possible by accessing the irq status register (isr). see section 6.2.3, irq interrupts, for details. interrupts held pending due to edge detection are cleared by a power-on reset or a manual reset. if two of these interrupts have the same priority level or if multiple interrupts occur within a single module, the interrupt with the highest default priority or the highest priority within its ipr setting range (as indicated in table 6.3) is selected. 3. the interrupt controller compares the priority level of the selected interrupt request with the interrupt mask bits (i3?i0) in the cpu?s status register (sr). if the request priority level is equal to or less than the level set in i3?i0, the request is ignored. if the request priority level is higher than the level in bits i3?i0, the interrupt controller accepts the interrupt and sends an interrupt request signal to the cpu. 4. when the interrupt controller accepts an interrupt, a low level is output from the irqout pin. 5. the cpu detects the interrupt request sent from the interrupt controller when it decodes the next instruction to be executed. instead of executing the decoded instruction, the cpu starts interrupt exception processing (figure 6.5). 6. sr and pc are saved onto the stack. 7. the priority level of the accepted interrupt is copied to the interrupt mask level bits (i3 to i0) in the status register (sr). 8. when the accepted interrupt is sensed by level or is from an on-chip peripheral module, a high level is output from the irqout pin. when the accepted interrupt is sensed by edge, a high level is output from the irqout pin at the point when the cpu starts interrupt exception processing instead of instruction execution as noted in (5) above. however, if the interrupt controller accepts an interrupt with a higher priority than one it is in the midst of accepting, the irqout pin will remain low level. 9. the cpu reads the start address of the exception service routine from the exception vector table for the accepted interrupt, jumps to that address, and starts executing the program there. this jump is not a delay branch.
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 90 of 818 rej09b0273-0500 no yes nmi? no yes user break? no yes level 15 interrupt? no yes i3 to i0 level 14? no yes level 14 interrupt? no yes yes i3 to i0 level 13? no yes level 1 interrupt? no yes i3 to i0 = level 0? no program execution state irqout = low level* 1 save sr to stack save pc to stack irqout = high level* 2 branches to exception service routine i3 to i0: interrupt mask bits of status register interrupt? copy accept-interrupt level to i3 to i0 reads exception vector table notes: 1. 2. irqout is the same signal as the interrupt request signal to the cpu (see figure 6.1). thus, it is output when there is a higher priority interrupt request than the one in the i3 to i0 bits of the sr. when the accepted interrupt is sensed by edge, the irqout pin becomes high level at the point when the cpu starts interrupt exception processing instead of instruction execution (before sr is saved to the stack). if the interrupt controller has accepted another interrupt with a higher priority and has output an interrupt request to the cpu, the irqout pin will remain low level. figure 6.3 interrupt sequence flowchart
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 91 of 818 rej09b0273-0500 6.4.2 stack after interrupt exception processing figure 6.4 shows the stack after interrupt exception processing. 32 bits 32 bits pc * 1 sr address 4n ? 8 4n ? 4 4n sp * 2 notes: 1. 2. pc: start address of the next instruction (return destination instruction) after the executing instruction always be certain that sp is a multiple of 4 figure 6.4 stack after interrupt exception processing
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 92 of 818 rej09b0273-0500 6.5 interrupt response time table 6.5 indicates the interrupt response time, which is the time from the occurrence of an interrupt request until the interrupt exception processing starts and fetching of the first instruction of the interrupt service routine begins. figure 6.5 shows the pipeline when an irq interrupt is accepted. table 6.5 interrupt response time number of states item nmi, peripheral module irq notes dmac active judgment 0 or 1 1 1 state required for interrupt signals for which dmac activation is possible compare identified inter- rupt priority with sr mask level 23 wait for completion of sequence currently being executed by cpu x ( 0) the longest sequence is for interrupt or address-error exception processing (x = 4 + m1 + m2 + m3 + m4). if an interrupt-masking instruction follows, however, the time may be even longer. time from start of interrupt exception processing until fetch of first instruction of exception service routine starts 5 + m1 + m2 + m3 performs the pc and sr saves and vector address fetch. total: 7 + m1 + m2 + m3 8 + m1 + m2 + m3 minimum: 10 11 0.50 to 0.55 s at 20 mhz interrupt response time maximum: 12 + 2 (m1 + m2 + m3) + m4 12 + 2 (m1 + m2 + m3) + m4 0.95 s at 20 mhz * note: m1 ? m4 are the number of states needed for the following memory accesses. m1: sr save (longword write) m2: pc save (longword write) m3: vector address read (longword read) m4: fetch first instruction of interrupt service routine * when m1 = m2 = m3 = m4 = 1
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 93 of 818 rej09b0273-0500 fde mee mme ee fd f 3 1 3 interrupt acceptance irq m1 m2 1 m3 1 5 + m1 + m2 + m3 instruction (instruction replaced by interrupt exception processing) overrun fetch interrupt service routine start instruction f: d: e: m: instruction fetch (instruction fetched from memory where program is stored). instruction decoding (fetched instruction is decoded). instruction execution (data operation and address calculation is performed according to the results of decoding). memory access (data in memory is accessed). figure 6.5 pipeline when an irq interrupt is accepted 6.6 data transfer with interrupt request signals the following data transfers can be done using interrupt request signals: ? activate dmac only, without generating cpu interrupt among interrupt sources, those designated as dmac activating sources are masked and not input to the intc. the masking condition is listed below: mask condition = dme  (de0  source selection 0 + de1 source selection 1 + de2  source selection 2 + de3  source selection 3) figure 6.6 is a block diagram of interrupt controller.
section 6 interrupt controller (intc) rev. 5.00 jan 06, 2006 page 94 of 818 rej09b0273-0500 dmac interrupt source interrupt request flag (generated by dmac) clear interrupt request interrupt source (not designated as dmac activating sources) figure 6.6 block diagram of interrupt controller 6.6.1 handling cpu interrupt sources, but not dmac activating sources 1. either do not select the dmac as a source, or clear the dme bit to 0. 2. activating sources are applied to the cpu when interrupts occur. 3. the cpu clears interrupt sources with its interrupt processing routine and performs the necessary processing. 6.6.2 handling dmac activating sources but not cpu interrupt sources 1. select the dmac as a source and set the dme bit to 1. cpu interrupt sources are masked regardless of the interrupt priority level register settings. 2. activating sources are applied to the dmac when interrupts occur. 3. the dmac clears activating sources at the time of data transfer.
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 95 of 818 rej09b0273-0500 section 7 user break controller (ubc) 7.1 overview the user break controller (ubc) provides functions that simplify program debugging. break conditions are set in the ubc and a user break interrupt is generated according to the conditions of the bus cycle generated by the cpu, dmac, or dtc. this function makes it easy to design an effective self-monitoring debugger, enabling the chip to easily debug programs without using a large in-circuit emulator. 7.1.1 features the features of the user break controller are: ? break compare conditions can be set: ? address ? cpu cycle/dma cycle ? instruction fetch or data access ? read or write ? operand size: byte/word/longword ? user break interrupt generated upon satisfying break conditions. a user-designed user break interrupt exception processing routine can be run. ? select either to break in the cpu instruction fetch cycle before the instruction is executed or after.
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 96 of 818 rej09b0273-0500 7.1.2 block diagram figure 7.1 shows a block diagram of the ubc. internal bus bus interface break condition comparator module bus ubbr ubamrh ubarh ubamrl ubarl interrupt request interrupt controller user break interrupt generating circuit ubc ubarh, ubarl: ubamrh, ubamrl: ubbr: user break address registers h, l user break address mask registers h, l user break bus cycle register figure 7.1 user break controller block diagram
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 97 of 818 rej09b0273-0500 7.1.3 register configuration the ubc has the five registers shown in table 7.1. break conditions are established using these registers. table 7.1 register configuration name abbr. r/w initial value address * access size user break address register h ubarh r/w h'0000 h'ffff8600 8, 16, 32 user break address register l ubarl r/w h'0000 h'ffff8602 8, 16, 32 user break address mask register h ubamrh r/w h'0000 h'ffff8604 8, 16, 32 user break address mask register l ubamrl r/w h'0000 h'ffff8606 8, 16, 32 user break bus cycle register ubbr r/w h'0000 h'ffff8608 8, 16, 32 note: * in register access, three cycles are required for byte access and word access, and six cycles for longword access. 7.2 register descriptions 7.2.1 user break address register (ubar) ubarh: bit: 15 14 13 12 11 10 9 8 ubarh uba31 uba30 uba29 uba28 uba27 uba26 uba25 uba24 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 ubarh uba23 uba22 uba21 uba20 uba19 uba18 uba17 uba16 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 98 of 818 rej09b0273-0500 ubarl: bit: 15 14 13 12 11 10 9 8 ubarl uba15 uba14 uba13 uba12 uba11 uba10 uba9 uba8 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 ubarl uba7 uba6 uba5 uba4 uba3 uba2 uba1 uba0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w the user break address register (ubar) consists of user break address register h (ubarh) and user break address register l (ubarl). both are 16-bit readable/writable registers. ubarh stores the upper bits (bits 31 to 16) of the address of the break condition, while ubarl stores the lower bits (bits 15 to 0). ubarh and ubarl are initialized by a power on reset to h'0000. they are not initialized in software standby mode. ubarh bits 15 to 0?user break address 31 to 16 (uba31 to uba16): these bits store the upper bit values (bits 31 to 16) of the address of the break condition. ubarl bits 15 to 0?user break address 15 to 0 (uba15 to uba0): these bits store the lower bit values (bits 15 to 0) of the address of the break condition. 7.2.2 user break address mask register (ubamr) ubamrh: bit: 15 14 13 12 11 10 9 8 ubamrh ubm31 ubm30 ubm29 ubm28 ubm27 ubm26 ubm25 ubm24 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 ubamrh ubm23 ubm22 ubm21 ubm20 ubm19 ubm18 ubm17 ubm16 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 99 of 818 rej09b0273-0500 ubamrl: bit: 15 14 13 12 11 10 9 8 ubamrl ubm15 ubm14 ubm13 ubm12 ubm11 ubm10 ubm9 ubm8 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 ubamrl ubm7 ubm6 ubm5 ubm4 ubm3 ubm2 ubm1 ubm0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w the user break address mask register (ubamr) consists of user break address mask register h (ubamrh) and user break address mask register l (ubamrl). both are 16-bit readable/writable registers. ubamrh designates whether to mask any of the break address bits established in the ubarh, and ubamrl designates whether to mask any of the break address bits established in the ubarl. ubamrh and ubamrl are initialized by a power on reset to h'0000. they are not initialized in software standby mode. ubamrh bits 15 to 0?user break address mask 31 to 16 (ubm31 to ubm16): these bits designate whether to mask any of the break address 31 to 16 bits (uba31 to uba16) established in the ubarh. ubamrl bits 15 to 0?user break address mask 15 to 0 (ubm15 to ubm0): these bits designate whether to mask any of the break address 15 to 0 bits (uba15 to uba0) established in the ubarl. bits 15 ? 0: ubmn description 0 break address uban is included in the break conditions (initial value) 1 break address uban is not included in the break conditions note: n = 31 to 0
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 100 of 818 rej09b0273-0500 7.2.3 user break bus cycle register (ubbr) bit: 15 14 13 12 11 10 9 8 ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 cp1 cp0 id1 id0 rw1 rw0 sz1 sz0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w user break bus cycle register (ubbr) is a 16-bit readable/writable register that selects from among the following four break conditions: 1. cpu cycle/dma cycle 2. instruction fetch/data access 3. read/write 4. operand size (byte, word, longword) ubbr is initialized by a power on reset to h'0000. it is not initialized in software standby mode. bits 15 to 8?reserved: these bits always read as 0. the write value should always be 0. bits 7 and 6?cpu cycle/peripheral cycle select (cp1, cp0): these bits designate break conditions for cpu cycles or peripheral cycles (dma cycles). bit 7: cp1 bit 6: cp0 description 0 0 no user break interrupt occurs (initial value) 1 break on cpu cycles 1 0 break on peripheral cycles 1 break on both cpu and peripheral cycles
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 101 of 818 rej09b0273-0500 bits 5 and 4?instruction fetch/data access select (id1, id0): these bits select whether to break on instruction fetch and/or data access cycles. bit 5: id1 bit 4: id0 description 0 0 no user break interrupt occurs (initial value) 1 break on instruction fetch cycles 1 0 break on data access cycles 1 break on both instruction fetch and data access cycles bits 3 and 2?read/write select (rw1, rw0): these bits select whether to break on read and/or write cycles. bit 3: rw1 bit 2: rw0 description 0 0 no user break interrupt occurs (initial value) 1 break on read cycles 1 0 break on write cycles 1 break on both read and write cycles bits 1 and 0?operand size select (sz1, sz0): these bits select operand size as a break condition. bit 1: sz1 bit 0: sz0 description 0 0 operand size is not a break condition (initial value) 1 break on byte access 1 0 break on word access 1 break on longword access note: when breaking on an instruction fetch, set the sz0 bit to 0. all instructions are considered to be word-size accesses (even when there are instructions in on-chip memory and 2 instruction fetches are done simultaneously in 1 bus cycle). operand size is word for instructions or determined by the operand size specified for the cpu/dmac data access. it is not determined by the bus width of the space being accessed.
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 102 of 818 rej09b0273-0500 7.3 operation 7.3.1 flow of the user break operation the flow from setting of break conditions to user break interrupt exception processing is described below: 1. the user break addresses are set in the user break address register (ubar), the desired masked bits in the addresses are set in the user break address mask register (ubamr) and the breaking bus cycle type is set in the user break bus cycle register (ubbr). if even one of the three groups of the ubbr?s cpu cycle/peripheral cycle select bits (cp1, cp0), instruction fetch/data access select bits (id1, id0), and read/write select bits (rw1, rw0) is set to 00 (no user break interrupt is generated), no user break interrupt will be generated even if all other conditions are in agreement. when using user break interrupts, always be certain to establish bit conditions for all of these three groups. 2. the ubc uses the method shown in figure 7.2 to judge whether set conditions have been fulfilled. when the set conditions are satisfied, the ubc sends a user break interrupt request signal to the interrupt controller (intc). 3. the interrupt controller checks the accepted user break interrupt request signal?s priority level. the user break interrupt has priority level 15, so it is accepted only if the interrupt mask level in bits i3?i0 in the status register (sr) is 14 or lower. when the i3?i0 bit level is 15, the user break interrupt cannot be accepted but it is held pending until user break interrupt exception processing can be carried out. consequently, user break interrupts within nmi exception service routines cannot be accepted, since the i3?i0 bit level is 15. however, if the i3?i0 bit level is changed to 14 or lower at the start of the nmi exception service routine, user break interrupts become acceptable thereafter. section 6, interrupt controller, describes the handling of priority levels in greater detail. 4. the intc sends the user break interrupt request signal to the cpu, which begins user break interrupt exception processing upon receipt. see section 6.4, interrupt operation, for details on interrupt exception processing.
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 103 of 818 rej09b0273-0500 sz1 sz0 user break interrupt rw1 rw0 id1 id0 cp1 cp0 ubarh/ubarl ubamrh/ubamrl 32 32 32 32 32 internal address bits 31 ? 0 cpu cycle dma cycle instruction fetch data access read cycle write cycle byte size word size longword size figure 7.2 break condition judgment method
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 104 of 818 rej09b0273-0500 7.3.2 break on on-chip memory instruction fetch cycle on-chip memory (on-chip rom and/or ram) is always accessed as 32 bits in 1 bus cycle. therefore, 2 instructions can be retrieved in 1 bus cycle when fetching instructions from on-chip memory. at such times, only 1 bus cycle is generated, but by setting the start addresses of both instructions in the user break address register (ubar) it is possible to cause independent breaks. in other words, when wanting to effect a break using the latter of two addresses retrieved in 1 bus cycle, set the start address of that instruction in ubar. the break will occur after execution of the former instruction. 7.3.3 program counter (pc) values saved break on instruction fetch (before execution): the program counter (pc) value saved to the stack in user break interrupt exception processing is the address that matches the break condition. the user break interrupt is generated before the fetched instruction is executed. if a break condition is set in an instruction fetch cycle placed immediately after a delayed branch instruction (delay slot), or on an instruction that follows an interrupt-disabled instruction, however, the user break interrupt is not accepted immediately, but the break condition establishing instruction is executed. the user break interrupt is accepted after execution of the instruction that has accepted the interrupt. in this case, the pc value saved is the start address of the instruction that will be executed after the instruction that has accepted the interrupt. break on data access (cpu/peripheral): the program counter (pc) value is the top address of the next instruction after the last instruction executed before the user break exception processing started. when data access (cpu/peripheral) is set as a break condition, the place where the break will occur cannot be specified exactly. the break will occur at the instruction fetched close to where the data access that is to receive the break occurs.
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 105 of 818 rej09b0273-0500 7.4 use examples 7.4.1 break on cpu instruction fetch cycle 1. register settings: ubarh = h'0000 ubarl = h'0404 ubbr = h'0054 conditions set: address: h'00000404 bus cycle: cpu, instruction fetch, read (operand size not included in conditions) a user break interrupt will occur before the instruction at address h'00000404. if it is possible for the instruction at h'00000402 to accept an interrupt, the user break exception processing will be executed after execution of that instruction. the instruction at h'00000404 is not executed. the pc value saved is h'00000404. 2. register settings: ubarh = h'0015 ubarl = h'389c ubbr = h'0058 conditions set: address: h'0015389c bus cycle: cpu, instruction fetch, write (operand size not included in conditions) a user break interrupt does not occur because the instruction fetch cycle is not a write cycle. 3. register settings: ubarh = h'0003 ubarl = h'0147 ubbr = h'0054 conditions set: address: h'00030147 bus cycle: cpu, instruction fetch, read (operand size not included in conditions) a user break interrupt does not occur because the instruction fetch was performed for an even address. however, if the first instruction fetch address after the branch is an odd address set by these conditions, user break interrupt exception processing will be done after address error exception processing.
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 106 of 818 rej09b0273-0500 7.4.2 break on cpu data access cycle 1. register settings: ubarh = h'0012 ubarl = h'3456 ubbr = h'006a conditions set: address: h'00123456 bus cycle: cpu, data access, write, word a user break interrupt occurs when word data is written into address h'00123456. 2. register settings: ubarh = h'00a8 ubarl = h'0391 ubbr = h'0066 conditions set: address: h'00a80391 bus cycle: cpu, data access, read, word a user break interrupt does not occur because the word access was performed on an even address. 7.4.3 break on dma/dtc cycle 1. register settings: ubarh = h'0076 ubarl = h'bcdc ubbr = h'00a7 conditions set: address: h'0076bcdc bus cycle: dma, data access, read, longword a user break interrupt occurs when longword data is read from address h'0076bcdc. 2. register settings: ubarh = h'0023 ubarl = h'45c8 ubbr = h'0094 conditions set: address: h'002345c8 bus cycle: dma, instruction fetch, read (operand size not included in conditions) a user break interrupt does not occur because no instruction fetch is performed in the dma/ctc cycle.
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 107 of 818 rej09b0273-0500 7.5 cautions on use 7.5.1 on-chip memory instruction fetch two instructions are simultaneously fetched from on-chip memory. if a break condition is set on the second of these two instructions but the contents of the ubc break condition registers are changed so as to alter the break condition immediately after the first of the two instructions is fetched, a user break interrupt will still occur when the second instruction is fetched. 7.5.2 instruction fetch at branches when a conditional branch instruction or trapa instruction causes a branch, instructions are fetched and executed as follows: 1. conditional branch instruction, branch taken: bt, bf trapa instruction, branch taken: trapa instruction fetch cycles: conditional branch fetch next-instruction overrun fetch next-instruction overrun fetch branch destination fetch instruction execution: conditional branch instruction execution branch destination instruction execution 2. when branching with a delayed conditional instruction: bt/s and bf/s instructions instruction fetch order: corresponding instruction fetch next instruction fetch (delay slot) overrun fetch of instruction after next branch destination instruction fetch instruction execution order: corresponding instruction execution delay slot instruction execution branch destination instruction execution when a conditional branch instruction or trapa instruction causes a branch, the branch destination will be fetched after the next instruction or the one after that does an overrun fetch. however, because the instruction that is the object of the break first breaks after a definite instruction fetch and execution, the kind of overrun fetch instructions noted above do not become objects of a break. if data access breaks are also included with instruction fetch breaks as break conditions, a break occurs because the instruction overrun fetch is also regarded as becoming a data break.
section 7 user break controller (ubc) rev. 5.00 jan 06, 2006 page 108 of 818 rej09b0273-0500 7.5.3 contention between user break and exception handling if a user break is set for the fetch of a particular instruction, and exception handling with higher priority than a user break is in contention and is accepted in the decode stage for that instruction (or the next instruction), user break exception handling may not be performed after completion of the higher-priority exception handling routine (on return by rte). 7.5.4 break at non-delay branch instruction jump destination when a branch instruction with no delay slot (including exception handling) jumps to the jump destination instruction on execution of the branch, a user break will not be generated even if a user break condition has been set for the first jump destination instruction fetch.
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 109 of 818 rej09b0273-0500 section 8 bus state controller (bsc) 8.1 overview the bus state controller (bsc) divides up the address spaces and outputs control for various types of memory. this enables memories like sram, and rom to be linked directly to the lsi without external circuitry. 8.1.1 features the bsc has the following features: ? address space is divided into four spaces ? a maximum linear 2 mbytes for on-chip rom effective mode, and a maximum linear 4-mbyte for on-chip rom ineffective mode for address space cs0 ? a maximum linear 4 mbytes for each of the address spaces cs1?cs3 ? bus width can be selected for each space (8 or 16 bits) ? wait states can be inserted by software for each space ? wait state insertion with wait pin in external memory space access ? outputs control signals for each space according to the type of memory connected ? on-chip rom and ram interfaces ? on-chip ram access of 32 bits in 1 state
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 110 of 818 rej09b0273-0500 8.1.2 block diagram figure 8.1 shows the bsc block diagram. ramer wcr1 wcr2 bcr1 bcr2 internal bus module bus bus interface on-chip memory control unit memory control unit wait control unit area control unit w rh , wrl cs0 ? cs3 rd wait bsc wcr1: wait control register 1 wcr2: wait control register 2 ramer: ram emulation register bcr1: bus control register 1 bcr2: bus control register 2 figure 8.1 bsc block diagram
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 111 of 818 rej09b0273-0500 8.1.3 pin configuration table 8.1 shows the bus state controller pin configuration. table 8.1 pin configuration signal i/o description a21?a0 o address output d15?d0 i/o 16-bit data bus. cs0 ? cs3 o chip select, indicating the area being accessed rd o strobe that indicates the read cycle for ordinary space/multiplex i/o. wrh o strobe that indicates a write cycle to the 3rd byte (d15?d8) for ordinary space/multiplex i/o. also output during dram access. wrl o strobe that indicates a write cycle to the least significant byte (d7?d0) for ordinary space/multiplex i/o. also output during dram access. wait i wait state request signal breq i bus release request input back o bus use enable output note: when an 8-bit bus width is selected for external space, wrl is enabled. when a 16-bit bus width is selected for external space, wrh and wrl are enabled. 8.1.4 register configuration the bsc has eight registers. these registers are used to control wait states, bus width, and interfaces with memories like rom and sram, as well as refresh control. the register configurations are listed in table 8.2. all registers are 16 bits. all bsc registers are all initialized by a power-on reset, but are not by a manual reset. values are maintained in standby mode.
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 112 of 818 rej09b0273-0500 table 8.2 register configuration name abbr. r/w initial value address access size bus control register 1 bcr1 r/w h'000f h'ffff8620 8, 16, 32 bus control register 2 bcr2 r/w h'ffff h'ffff8622 8, 16, 32 wait state control register 1 wcr1 r/w h'ffff h'ffff8624 8, 16, 32 wait state control register 2 wcr2 r/w h'000f h'ffff8626 8, 16, 32 ram emulation register ramer r/w h'0000 h'ffff8628 8, 16, 32 notes: 1. when using a longword access to write to ramer , always write 0 in the lower word (address h'ffff8630). operation cannot be guaranteed if a non-zero value is written. 2. in register access, three cycles are required for byte access and word access, and six cycles for longword access. 8.1.5 address map figure 8.2 shows the address format used by the sh7050 series. a31 ? a24 a23, a22 a21 output address: output from the address pins space selection: not output externally; used to select the type of space on-chip rom space or cs0 to cs3 space when 00000000 (h'00) dram space when 00000001 (h'01) reserved (do not access) when 00000010 to 11111110 (h'01 to h'fe) on-chip peripheral module space or on-chip ram space when 11111111 (h'ff) cs space selection: decoded, outputs cs0 to cs3 when a31 to a24 = 00000000 a0 figure 8.2 address format this lsi uses 32-bit addresses: ? a31 to a24 are used to select the type of space and are not output externally. ? bits a23 and a22 are decoded and output as chip select signals ( cs0 to cs3 ) for the corresponding areas when bits a31 to a24 are 00000000. ? a21 to a0 are output externally.
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 113 of 818 rej09b0273-0500 table 8.3 and table 8.4 show address map. table 8.3 address map (128 kb rom/6 kb ram version)  on-chip rom effective mode address space memory size bus width h'0000 0000 to h'0001 ffff on-chip rom on-chip rom 128 kb 32bit h'0002 0000 to h'001f ffff reserved reserved h'0020 0000 to h'003f ffff cs0 space external space 2 mb 8, 16 bit * 1 h'0040 0000 to h'007f ffff cs1 space external space 4 mb 8, 16 bit * 1 h'0080 0000 to h'00bf ffff cs2 space external space 4 mb 8, 16 bit * 1 h'00c0 0000 to h'00ff ffff cs3 space external space 4 mb 8, 16 bit * 1 h'0100 0000 to h'ffff 7fff reserved reserved h'ffff 8000 to h'ffff 87ff on-chip peripheral module on-chip peripheral module 2 kb 8, 16 bit h'ffff 8800 to h'ffff e7ff reserved reserved h'ffff e800 to h'ffff ffff on-chip ram on-chip ram 6 kb 32 bit  on-chip rom ineffective mode address space memory size bus width h'0000 0000 to h'003f ffff cs0 space external space 4 mb 8, 16 bit * 2 h'0040 0000 to h'007f ffff cs1 space external space 4 mb 8, 16 bit * 1 h'0080 0000 to h'00bf ffff cs2 space external space 4 mb 8, 16 bit * 1 h'00c0 0000 to h'00ff ffff cs3 space external space 4 mb 8, 16 bit * 1 h'0100 0000 to h'ffff 7fff reserved reserved h'ffff 8000 to h'ffff 87ff on-chip peripheral module on-chip peripheral module 2 kb 8, 16 bit h'ffff 8800 to h'ffff e7ff reserved reserved h'ffff e800 to h'ffff ffff on-chip ram on-chip ram 6 kb 32 bit notes: 1. selected by on-chip register settings. 2. selected by the mode pin. do not access reserved spaces. operation cannot be guaranteed if they are accessed.
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 114 of 818 rej09b0273-0500 table 8.4 address map (256 kb rom/10 kb ram version)  on-chip rom effective mode address space memory size bus width h'0000 0000 to h'0003 ffff on-chip rom on-chip rom 256 kb 32 bit h'0004 0000 to h'001f ffff reserved reserved h'0020 0000 to h'003f ffff cs0 space external space 2 mb 8, 16 bit * 1 h'0040 0000 to h'007f ffff cs1 space external space 4 mb 8, 16 bit * 1 h'0080 0000 to h'00bf ffff cs2 space external space 4 mb 8, 16 bit * 1 h'00c0 0000 to h'00ff ffff cs3 space external space 4 mb 8, 16 bit * 1 h'0100 0000 to h'ffff 7fff reserved reserved h'ffff 8000 to h'ffff 87ff on-chip peripheral module on-chip peripheral module 2 kb 8, 16 bit h'ffff 8800 to h'ffff d7ff reserved reserved h'ffff d800 to h'ffff ffff on-chip ram on-chip ram 10 kb 32 bit  on-chip rom ineffective mode address space memory size bus width h'0000 0000 to h'003f ffff cs0 space external space 4 mb 8, 16 bit * 2 h'0040 0000 to h'007f ffff cs1 space external space 4 mb 8, 16 bit * 1 h'0080 0000 to h'00bf ffff cs2 space external space 4 mb 8, 16 bit * 1 h'00c0 0000 to h'00ff ffff cs3 space external space 4 mb 8, 16 bit * 1 h'0100 0000 to h'ffff 7fff reserved reserved h'ffff 8000 to h'ffff 87ff on-chip peripheral module on-chip peripheral module 2 kb 8, 16 bit h'ffff 8800 to h'ffff d7ff reserved reserved h'ffff d800 to h'ffff ffff on-chip ram on-chip ram 10 kb 32 bit notes: 1. selected by on-chip register settings. 2. selected by the mode pin. do not access reserved spaces. operation cannot be guaranteed if they are accessed.
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 115 of 818 rej09b0273-0500 8.2 description of registers 8.2.1 bus control register 1 (bcr1) bit: 15 14 13 12 11 10 9 8 ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 ???? a3sz a2sz a1sz a0sz initial value:00001111 r/w:rrrrr/wr/wr/wr/w bcr1 is a 16-bit read/write register that specifies the bus size of the cs spaces. write bits 15?0 of bcr1 during the initialization stage after a power-on reset, and do not change the values thereafter. in on-chip rom effective mode, do not access any of the cs spaces until after completion of register initialization. in on-chip rom ineffective mode, do not access any cs space other than cs0 until after completion of register initialization. bcr1 is initialized to h'000f by a power-on reset and in hardware standby mode. it is not initialized in software standby mode. bits 15?4?reserved: these bits always read as 0. the write value should always be 0. bit 3?cs3 space size specification (a3sz): specifies the cs3 space bus size. a 0 setting specifies byte (8-bit) size, and a 1 setting specifies word (16-bit) size. bit 3: a3sz description 0 byte (8 bit) size 1 word (16 bit) size (initial value) bit 2?cs2 space size specification (a2sz): specifies the cs2 space bus size. a 0 setting specifies byte (8-bit) size, and a 1 setting specifies word (16-bit) size.
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 116 of 818 rej09b0273-0500 bit 2: a2sz description 0 byte (8 bit) size 1 word (16 bit) size (initial value) bit 1?cs1 space size specification (a1sz): specifies the cs1 space bus size. a 0 setting specifies byte (8-bit) size, and a 1 setting specifies word (16-bit) size. bit 1: a1sz description 0 byte (8 bit) size 1 word (16 bit) size (initial value) bit 0?cs0 space size specification (a0sz): specifies the cs0 space bus size a 0 setting specifies byte (8-bit) size, and a 1 setting specifies word (16-bit) size. bit 0: a0sz description 0 byte (8 bit) size 1 word (16 bit) size (initial value) note: a0sz is effective only in on-chip rom effective mode. in on-chip rom ineffective mode, the cs0 space bus size is specified by the mode pin. 8.2.2 bus control register 2 (bcr2) bit: 15 14 13 12 11 10 9 8 iw31 iw30 iw21 iw20 iw11 iw10 iw01 iw00 initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 cw3 cw2 cw1 cw0 sw3 sw2 sw1 sw0 initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bcr2 is a 16-bit read/write register that specifies the number of idle cycles and cs signal assert extension of each cs space. bcr2 is initialized by a power-on reset and in hardware standby mode to h'ffff. it is not initialized by software standby mode.
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 117 of 818 rej09b0273-0500 bits 15?8?idles between cycles (iw31, iw30, iw21, iw20, iw11, iw10, iw01, iw00): these bits specify idle cycles inserted between consecutive accesses when the second one is to a different cs area after a read. idles are used to prevent data conflict between rom (and other memories, which are slow to turn the read data buffer off), fast memories, and i/o interfaces. even when access is to the same area, idle cycles must be inserted when a read access is followed immediately by a write access. the idle cycles to be inserted comply with the area specification of the previous access . refer to section 10.6, waits between access cycles, for details. iw31, iw30 specify the idle between cycles for cs3 space; iw21, iw20 specify the idle between cycles for cs2 space; iw11, iw10 specify the idle between cycles for cs1 space and iw01, iw00 specify the idle between cycles for cs0 space. bit 15: iw31 bit 14: iw30 description 0 0 no idle cycle after accessing cs3 space 1 inserts one idle cycle 1 0 inserts two idle cycles 1 inserts three idle cycles ( initial value) bit 13: iw21 bit 12: iw20 description 0 0 no idle cycle after accessing cs2 space 1 inserts one idle cycle 1 0 inserts two idle cycles 1 inserts three idle cycles ( initial value) bit 11: iw11 bit 10: iw10 description 0 0 no idle cycle after accessing cs1 space 1 inserts one idle cycle 1 0 inserts two idle cycles 1 inserts three idle cycles ( initial value) bit 9: iw01 bit 8: iw00 description 0 0 no idle cycle after accessing cs0 space 1 inserts one idle cycle 1 0 inserts two idle cycles 1 inserts three idle cycles ( initial value)
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 118 of 818 rej09b0273-0500 bits 7?4?idle specification for continuous access (cw3, cw2, cw1, cw0): the continuous access idle specification makes insertions to clearly delineate the bus intervals by once negating the csn signal when doing consecutive accesses of the same cs space. when a write immediately follows a read, the number of idle cycles inserted is the larger of the two values specified by iw and cw. refer to section 8.4, waits between access cycles, for details. cw3 specifies the continuous access idles for cs3 space; cw2 specifies the continuous access idles for cs2 space; cw1 specifies the continuous access idles for cs1 space and cw0 specifies the continuous access idles for cs0 space. bit 7: cw3 description 0 no cs3 space continuous access idle cycles 1 one cs3 space continuous access idle cycle (initial value) bit 6: cw2 description 0 no cs2 space continuous access idle cycles 1 one cs2 space continuous access idle cycle (initial value) bit 5: cw1 description 0 no cs1 space continuous access idle cycles 1 one cs1 space continuous access idle cycle (initial value) bit 4: cw0 description 0 no cs0 space continuous access idle cycles 1 one cs0 space continuous access idle cycle (initial value) bits 3?0? cs cs cs cs assert extension specification (sw3, sw2, sw1, sw0): the cs assert cycle extension specification is for making insertions to prevent extension of the rd signal or wrx signal assert period beyond the length of the csn signal assert period. extended cycles insert one cycle before and after each bus cycle, which simplifies interfaces with external devices and also has the effect of extending write data hold time. refer to section 8.3.3 cs assert period extension for details. sw3 specifies the cs assert extension for cs3 space access; sw2 specifies the cs assert extension for cs2 space access; sw1 specifies the cs assert extension for cs1 space access and sw0 specifies the cs assert extension for cs0 space access.
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 119 of 818 rej09b0273-0500 bit 3: sw3 description 0 no cs3 space cs assert extension 1cs3 space cs assert extension (initial value) bit 2: sw2 description 0 no cs2 space cs assert extension 1cs2 space cs assert extension (initial value) bit 1: sw1 description 0 no cs1 space cs assert extension 1cs1 space cs assert extension (initial value) bit 0: sw0 description 0 no cs0 space cs assert extension 1cs0 space cs assert extension (initial value) 8.2.3 wait control register 1 (wcr1) bit: 15 14 13 12 11 10 9 8 w33 w32 w31 w30 w23 w22 w21 w20 initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 w13 w12 w11 w10 w03 w02 w01 w00 initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w wcr1 is a 16-bit read/write register that specifies the number of wait cycles (0?15) for each cs space. wcr1 is initialized by a power-on reset and in hardware standby mode to h'ffff. it is not initialized by software standby mode. bits 15?12?cs3 space wait specification (w33, w32, w31, w30): specifies the number of waits for cs3 space access.
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 120 of 818 rej09b0273-0500 bit 15: w33 bit 14: w32 bit 13: w31 bit 12: w30 description 0 0 0 0 no wait (external wait input disabled) 0 0 0 1 1 wait external wait input enabled ??? 1 1 1 1 15 wait external wait input enabled (initial value) bits 11?8?cs2 space wait specification (w23, w22, w21, w20): specifies the number of waits for cs2 space access. bit 11: w23 bit 10: w22 bit 9: w21 bit 8: w20 description 0 0 0 0 no wait (external wait input disabled) 0 0 0 1 1 wait external wait input enabled ??? 1 1 1 1 15 wait external wait input enabled (initial value) bits 7?4?cs1 space wait specification (w13, w12, w11, w10): specifies the number of waits for cs1 space access. bit 7: w13 bit 6: w12 bit 5: w11 bit 4: w10 description 0 0 0 0 no wait (external wait input disabled) 0 0 0 1 1 wait external wait input enabled ??? 1 1 1 1 15 wait external wait input enabled (initial value) bits 3?0?cs0 space wait specification (w03, w02, w01, w00): specifies the number of waits for cs0 space access. bit 3: w03 bit 2: w02 bit 1: w01 bit 0: w00 description 0 0 0 0 no wait (external wait input disabled) 0 0 0 1 1 wait external wait input enabled ??? 1 1 1 1 15 wait external wait input enabled (initial value)
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 121 of 818 rej09b0273-0500 8.2.4 wait control register 2 (wcr2) bit: 15 14 13 12 11 10 9 8 ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 ???? dsw3 dsw2 dsw1 dsw0 initial value:00001111 r/w:rrrrr/wr/wr/wr/w wcr2 is a 16-bit read/write register that specifies the number of access cycles for dram space and cs space for dma single address mode transfers. do not perform any dma single address transfers before wcr2 is set. wcr2 is initialized by a power-on reset and in hardware standby mode to h'000f. it is not initialized by software standby mode. bits 15?4?reserved: these bits always read as 0. the write value should always be 0. bits 3?0?cs space dma single address mode access wait specification (dsw3, dsw2, dsw1, dsw0): specifies the number of waits for cs space access (0?15) during dma single address mode accesses. these bits are independent of the w bits of the wcr1. bit 3: dsw3 bit 2: dsw2 bit 1: dsw1 bit 0: dsw0 description 0 0 0 0 no wait (external wait input disabled) 0 0 0 1 1 wait (external wait input enabled) ??? 1 1 1 1 15 wait (external wait input enabled) (initial value)
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 122 of 818 rej09b0273-0500 8.2.5 ram emulation register (ramer) bit: 15 14 13 12 11 10 9 8 ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 ????? rams ram1 ram0 initial value:00000000 r/w:rrrrrr/wr/wr/w the ram emulation register (ramer) is a 16-bit readable/writable register that selects the ram area to be used when emulating realtime programming of flash memory. ramer is initialized to h'0000 by a power-on reset and in hardware standby mode. it is not initialized in software standby mode. note: to ensure correct operation of the ram emulation function, the rom for which ram emulation is performed should not be accessed immediately after this register has been modified. operation cannot be guaranteed if such an access is made. bits 15 to 3?reserved: only 0 should be written to these bits. operation cannot be guaranteed if 1 is written. bit 2?ram select (rams): used together with bits 1 and 0 to designate the ram area (table 8.5 and table 8.6). when 1 is written to this bit, all flash memory blocks are write/erase-protected. this bit is ignored in modes with no on-chip rom. bits 1 and 0?ram area specification (ram1, ram0): these bits are used together with the rams bit to designate the ram area (tables 8.5 and 8.6).
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 123 of 818 rej09b0273-0500 table 8.5 ram area setting method (128 kb rom/6 kb ram version) ram area bit 2: rams bit 1: ram1 bit 0: ram0 h'ffff e800 to h'ffff ebff 0 ** h'0001 f000 to h'0001 f3ff 1 0 0 h'0001 f400 to h'0001 f7ff 1 0 1 h'0001 f800 to h'0001 fbff 1 1 0 h'0001 fc00 to h'0001 ffff 1 1 1 * : don ? t care table 8.6 ram area setting method (256 kb rom/10 kb ram version) ram area bit 2: rams bit 1: ram1 bit 0: ram0 h'ffff d800 to h'ffff dbff 0 ** h'0003 f000 to h'0003 f3ff 1 0 0 h'0003 f400 to h'0003 f7ff 1 0 1 h'0003 f800 to h'0003 fbff 1 1 0 h'0003 fc00 to h'0003 ffff 1 1 1 * : don ? t care
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 124 of 818 rej09b0273-0500 8.3 accessing ordinary space a strobe signal is output by ordinary space accesses to provide primarily for sram or rom direct connections. 8.3.1 basic timing figure 8.3 shows the basic timing of ordinary space access. ordinary access bus cycles are performed in 2 states. t 1 ck address csn rd read write data wrx data t 2 figure 8.3 basic timing of ordinary space access
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 125 of 818 rej09b0273-0500 8.3.2 wait state control the number of wait states inserted into ordinary space access states can be controlled using the wcr settings (figure 8.4). t 1 t w ck read write address csn rd data wrx data t 2 figure 8.4 wait timing of ordinary space access (software wait only)
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 126 of 818 rej09b0273-0500 when the wait is specified by software using wcr, the wait input wait signal from outside is sampled. figure 8.5 shows the wait signal sampling. the wait signal is sampled at the clock rise one cycle before the clock rise when t w state shifts to t 2 state. when using external waits, use a wcr setting of 1 state or more when extending cs assertion, and 2 states or more otherwise. t 1 t w ck read write address csn wait rd data wrx data t w t w 0 t 2 figure 8.5 wait state timing of ordinary space access (wait states from software wait 2 state + wait wait wait wait signal)
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 127 of 818 rej09b0273-0500 8.3.3 cs cs cs cs assert period extension idle cycles can be inserted to prevent extension of the rd signal or wrx signal assert period beyond the length of the csn signal assert period by setting the sw3?sw0 bits of bcr2. this allows for flexible interfaces with external circuitry. the timing is shown in figure 8.6. t h and t f cycles are added respectively before and after the ordinary cycle. only csn is asserted in these cycles; rd and wrx signals are not. further, data is extended up to the t f cycle, which is effective for gate arrays and the like, which have slower write operations. t h t 1 ck read write address csn rd data wrx data t 2 t f figure 8.6 cs cs cs cs assert period extension function
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 128 of 818 rej09b0273-0500 8.4 waits between access cycles when a read from a slow device is completed, data buffers may not go off in time to prevent data conflicts with the next access. if there is a data conflict during memory access, the problem can be solved by inserting a wait in the access cycle. to enable detection of bus cycle starts, waits can be inserted between access cycles during continuous accesses of the same cs space by negating the csn signal once. 8.4.1 prevention of data bus conflicts for the two cases of write cycles after read cycles, and read cycles for a different area after read cycles, waits are inserted so that the number of idle cycles specified by the iw31 to iw00 bits of the bcr2 and the diw of the dcr occur. when idle cycles already exist between access cycles, only the number of empty cycles remaining beyond the specified number of idle cycles are inserted. figure 8.7 shows an example of idles between cycles. in this example, 1 idle between csn space cycles has been specified, so when a csm space write immediately follows a csn space read cycle, 1 idle cycle is inserted.
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 129 of 818 rej09b0273-0500 ck csn csm rd data csn space read csm space write idle cycle wrx address t 1 t 2 t 1 t 2 t idle figure 8.7 idle cycle insertion example iw31 and iw30 specify the number of idle cycles required after a cs3 space read either to read other external spaces, or for this lsi, to do write accesses. in the same manner, iw21 and iw20 specify the number of idle cycles after a cs2 space read, iw11 and iw10, the number after a cs1 space read, and iw01 and iw00, the number after a cs0 space read. diw specifies the number of idle cycles required, after a dram space read either to read other external spaces (cs space), or for this lsi, to do write accesses. 0 to 3 cycles can be specified for cs space, and 0 to 1 cycle for dram space.
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 130 of 818 rej09b0273-0500 8.4.2 simplification of bus cycle start detection for consecutive accesses of the same cs space, waits are inserted so that the number of idle cycles designated by the cw3 to cw0 bits of the bcr2 occur. however, for write cycles after reads, the number of idle cycles inserted will be the larger of the two values defined by the iw and cw bits. when idle cycles already exist between access cycles, waits are not inserted. figure 8.8 shows an example. a continuous access idle is specified for csn space, and csn space is consecutively write accessed. ck csn rd wrx data csn space access csn space access idle cycle address t 1 t 2 t 1 t 2 t idle figure 8.8 same space consecutive access idle cycle insertion example
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 131 of 818 rej09b0273-0500 8.5 bus arbitration the sh7050 series has a bus arbitration function that, when a bus release request is received from an external device, releases the bus to that device. it also has two internal bus masters, the cpu and the dmac, dtc. the priority ranking for determining bus right transfer between these bus masters is: bus right request from external device > dmac > cpu therefore, an external device that generates a bus request is given priority even if the request is made during a dmac burst transfer. a bus request by an external device should be input at the breq pin. the signal indicating that the bus has been released is output from the back pin. figure 8.9 shows the bus right release procedure. breq = low sh7050 series breq accepted strobe pin: high-level output address, data, strobe pin: high impedance bus right release response bus right release status external device bus right request back confirmation bus right acquisition back = low figure 8.9 bus right release procedure
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 132 of 818 rej09b0273-0500 8.6 memory connection examples figures 8.10?8.13 show examples of the memory connections. sh705x 32k 8 bit ce oe csn rd a0 ? a14 d0 ? d7 a0 ? a14 i/o0 ? i/o7 rom figure 8.10 8-bit data bus width rom connection sh705x 256k 16 bit rom ce oe csn rd a0 a1 ? a18 d0 ? d15 a0 ? a17 i/o0 ? i/o15 figure 8.11 16-bit data bus width rom connection
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 133 of 818 rej09b0273-0500 sh705x csn rd wrl we ce oe a0 ? a16 a0 ? a16 d0 ? d7 i/o0 ? i/o7 128k 8 bit sram figure 8.12 8-bit data bus width sram connection sh705x 128k 8 bit sram csn rd cs oe a0 a1 e a17 a0 e a16 wrh we d8 ? d15 i / o0 ? i/o7 wrl d0 ? d7 cs oe a0 ? a16 we i / o0 ? i/o7 figure 8.13 16-bit data bus width sram connection
section 8 bus state controller (bsc) rev. 5.00 jan 06, 2006 page 134 of 818 rej09b0273-0500
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 135 of 818 rej09b0273-0500 section 9 direct memory access controller (dmac) 9.1 overview the sh7050 series includes an on-chip four-channel direct memory access controller (dmac). the dmac can be used in place of the cpu to perform high-speed data transfers among external devices equipped with dack (transfer request acknowledge signal), external memories, memory- mapped external devices, and on-chip peripheral modules (except for the dmac, dtc, bsc, and ubc). using the dmac reduces the burden on the cpu and increases operating efficiency of the lsi as a whole. 9.1.1 features the dmac has the following features: ? four channels ? four gb of address space in the architecture ? byte, word, or longword selectable data transfer unit ? 16 mb (6,777,216 maximum) transfers ? single or dual address mode. dual address mode can be direct or indirect address transfer. ? single address mode: either the transfer source or transfer destination (peripheral device) is accessed by a dack signal while the other is accessed by address. one transfer unit of data is transferred in each bus cycle. ? dual address mode: both the transfer source and transfer destination are accessed by address. dual address mode can be direct or indirect address transfer. ? direct access: values set in a dmac internal register indicate the accessed address for both the transfer source and transfer destination. two bus cycles are required for one data transfer.  indirect access: the value stored at the location pointed to by the address set in the dmac internal transfer source register is used as the address. operation is otherwise the same as direct access. this function can only be set for channel 3. ? channel function: transfer modes that can be set are different for each channel. (dual address mode indirect access can only be set for channel 1. only direct access is possible for the other channels). ? channel 0: single or dual address mode. external requests are accepted. ? channel 1: single or dual address mode. external requests are accepted. ? channel 2: dual address mode only. source address reload function operates every fourth transfer.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 136 of 818 rej09b0273-0500 ? channel 3: dual address mode only. direct address transfer mode and indirect address transfer mode selectable. ? reload function: enables automatic reloading of the value set in the first source address register every fourth dma transfer. this function can be executed on channel 2 only. ? transfer requests: there are three dmac transfer activation requests, as indicated below. ? external request: from two dreq pins. dreq can be detected either by falling edge or by low level. external requests can only be received on channels 0 or 1. ? requests from on-chip peripheral modules: transfer requests from on-chip modules such as sci or a/d. these can be received by all channels. ? auto-request: the transfer request is generated automatically within the dmac. ? selectable bus modes: cycle-steal mode or burst mode ? two types of dmac channel priority ranking: ? fixed priority mode: always fixed ? round robin mode: sets the lowest priority level for the channel that received the execution request last ? cpu can be interrupted when the specified number of data transfers are complete.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 137 of 818 rej09b0273-0500 9.1.2 block diagram figure 9.1 is a block diagram of the dmac. on-chip rom peripheral bus internal bus on-chip ram dreq0 , dreq1 circuit control sarn dmac module register control activation control request priority control bus interface bus state controller on-chip peripheral module darn dmatcrn chcrn dmaor atu sci0?sci2 a/d converter 0, 1 dein external rom external ram external i/o (memory mapped) external i/o (with acknowledge) dack0, dack1 drak0, drak1 sarn: darn: dmatcrn: chcrn: dmaor: n: dmac source address register dmac destination address register dmac transfer count register dmac channel control register dmac operation register 0, 1, 2, 3 figure 9.1 dmac block diagram
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 138 of 818 rej09b0273-0500 9.1.3 pin configuration table 9.1 shows the dmac pins. table 9.1 dmac pin configuration channel name symbol i/o function 0 dma transfer request dreq0 i dma transfer request input from external device to channel 0 dma transfer request acknowledge dack0 o dma transfer strobe output from channel 0 to external device dreq0 acceptance confirmation drak0 o sampling receive acknowledge output for dma transfer request input from external source 1 dma transfer request dreq1 i dma transfer request input from external device to channel 1 dma transfer request acknowledge dack1 o dma transfer strobe output from channel 1 to external device dreq1 acceptance confirmation drak1 o sampling receive acknowledge output for dma transfer request input from external source 9.1.4 register configuration table 9.2 summarizes the dmac registers. dmac has a total of 17 registers. each channel has four control registers. one other control register is shared by all channels. there are two channel 0 dedicated registers, isar and idar, which preserve different initial transfer source and destination addresses than those of the sar0 and dar0. there is also an iar used by the indirect address mode.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 139 of 818 rej09b0273-0500 table 9.2 dmac registers chan- nel name abbrevi- ation r/w initial value address register size access size 0 dma source address register 0 sar0 r/w undefined h'ffff86c0 32 bit 16, 32 * 2 dma destination address register 0 dar0 r/w undefined h'ffff86c4 32 bit 16, 32 * 2 dma transfer count register 0 dmatcr0 r/w undefined h'ffff86c8 32 bit 32 * 2 dma channel control register 0 chcr0 r/w * 1 h'00000000 h'ffff86cc 32 bit 16, 32 * 2 1 dma source address register 1 sar1 r/w undefined h'ffff86d0 32 bit 16, 32 * 2 dma destination address register 1 dar1 r/w undefined h'ffff86d4 32 bit 16, 32 * 2 dma transfer count register 1 dmatcr1 r/w undefined h'ffff86d8 32 bit 32 * 3 dma channel control register 1 chcr1 r/w * 1 h'00000000 h'ffff86dc 32 bit 16, 32 * 2 2 dma source address register 2 sar2 r/w undefined h'ffff86e0 32 bit 16, 32 * 2 dma destination address register 2 dar2 r/w undefined h'ffff86e4 32 bit 16, 32 * 2 dma transfer count register 2 dmatcr2 r/w undefined h'ffff86e8 32 bit 32 * 3 dma channel control register 2 chcr2 r/w * 1 h'00000000 h'ffff86ec 32 bit 16, 32 * 2
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 140 of 818 rej09b0273-0500 chan- nel name abbrevi- ation r/w initial value address register size access size 3 dma source address register 3 sar3 r/w undefined h'ffff86f0 32 bit 16, 32 * 2 dma destination address register 3 dar3 r/w undefined h'ffff86f4 32 bit 16, 32 * 2 dma transfer count register 3 dmatcr3 r/w undefined h'ffff86f8 32 bit 32 * 3 dma channel control register 3 chcr3 r/w * 1 h'00000000 h'ffff86fc 32 bit 16, 32 * 2 shared dma operation register dmaor r/w * 1 h'0000 h'ffff86b0 16 bit 8, 16 * 4 notes: registers are accessed in three cycles when using word access and six cycles when using longword access. do not attempt to access an empty address. 1. write 0 after reading 1 in bit 1 of chcr0?chcr3 and in bits 1 and 2 of the dmaor to clear flags. no other writes are allowed. 2. for 16-bit access of sar0?sar3, dar0?dar3, and chcr0?chcr3, the 16-bit value on the side not accessed is held. 3. dmatcr has a 24-bit configuration: bits 0?23. writing to the upper 8 bits (bits 24?31) is invalid, and these bits always read 0. 4. do not make 32-bit access for dmaor. 9.2 register descriptions 9.2.1 dma source address registers 0?3 (sar0?sar3) dma source address registers 0?3 (sar0?sar3) are 32-bit read/write registers that specify the source address of a dma transfer. these registers have a count function, and during a dma transfer, they indicate the next source address. in single-address mode, sar values are ignored when a device with dack has been specified as the transfer source. specify a 16-bit boundary when performing 16-bit data transfers, and a 32-bit boundary when performing 32-bit data transfers. operation cannot be guaranteed if any other addresses are set. the initial value after power-on resets and in software standby mode is undefined.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 141 of 818 rej09b0273-0500 bit: 31 30 29 28 27 26 25 24 initial value:???????? r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 23 22 21 ? ? 2 1 0 ?? initial value:???????? r/w: r/w r/w r/w ? ? r/w r/w r/w 9.2.2 dma destination address registers 0?3 (dar0?dar3) dma destination address registers 0?3 (dar0?dar3) are 32-bit read/write registers that specify the destination address of a dma transfer. these registers have a count function, and during a dma transfer, they indicate the next destination address. in single-address mode, dar values are ignored when a device with dack has been specified as the transfer destination. specify a 16-bit boundary when performing 16-bit data transfers, and a 32-bit boundary when performing 32-bit data transfers. operation cannot be guaranteed if any other addresses are set. the value after power-on resets and in standby mode is undefined. bit: 31 30 29 28 27 26 25 24 initial value:???????? r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 23 22 21 ? ? 2 1 0 ?? initial value:???????? r/w: r/w r/w r/w ? ? r/w r/w r/w
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 142 of 818 rej09b0273-0500 9.2.3 dma transfer count registers 0?3 (dmatcr0?dmatcr3) dma transfer count registers 0?3 (dmatcr0?dmatcr3) are 24-bit read/write registers that specify the transfer count for the channel (byte count, word count, or longword count). specifying a h'000001 gives a transfer count of 1, while h'000000 gives the maximum setting, 16,777,216 transfers. the upper 8 bits of dmatcr always read 0. the write value, also, should always be 0. the value after power-on resets and in standby mode is undefined. always write 0 to the upper 8 bits of a dmatcr. bit: 31 30 29 28 27 26 25 24 ???????? initial value:00000000 r/w:rrrrrrrr bit: 23 22 21 20 19 18 17 16 initial value:???????? r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 15 14 13 12 11 10 9 8 initial value:???????? r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 initial value:???????? r/w: r/w r/w r/w r/w r/w r/w r/w r/w
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 143 of 818 rej09b0273-0500 9.2.4 dma channel control registers 0?3 (chcr0?chcr3) dma channel control registers 0?3 (chcr0?chcr3) is a 32-bit read/write register where the operation and transmission of each channel is designated. bits 31?21 and bit 7 should always read 0. the written value should also be 0. they are initialized to 0 by a power-on reset and in standby mode. bit: 31 30 29 28 27 26 25 24 ???????? initial value:00000000 r/w:rrrrrrrr bit: 23 22 21 20 19 18 17 16 ???dirorlamal initial value:00000000 r/w: r r r r/w r/w r/w r/w r/w bit: 15 14 13 12 11 10 9 8 dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 ?dstmts1ts0ietede initial value:00000000 r/w: r r/w r/w r/w r/w r/w r/(w) * r/w notes: 1. te bit: allows only 0 write after reading 1. 2. the di, ro, rl, am, al, or ds bit may be absent, depending on the channel. bit 20?direct/indirect (di): specifies either direct address mode operation or indirect address mode operation for channel 3 source address. this bit is valid only in chcr3. it always reads 0 for chcr0?chcr2, and cannot be modified. bit 20: di description 0 direct access mode operation for channel 3 (initial value) 1 indirect access mode operation for channel 3
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 144 of 818 rej09b0273-0500 bit 19?source address reload (ro): selects whether to reload the source address initial value during channel 2 transfer. this bit is valid only for channel 2. it always reads 0 for chcr0, chcr1, and chcr3, and cannot be modified. bit 19: ro description 0 does not reload source address (initial value) 1 reloads source address bit 18?request check level (rl): selects whether to output drak notifying external device of dreq received, with active high or active low. this bit is valid only for chcr0 and chcr1. it always reads 0 for chcr2 and chcr3, and cannot be modified. bit 18: rl description 0 output drak with active high (initial value) 1 output drak with active low bit 17?acknowledge mode (am): in dual address mode, selects whether to output dack in the data write cycle or data read cycle. in single address mode, dack is always output irrespective of the setting of this bit. this bit is valid only for chcr0 and chcr1. it always reads as 0 for chcr2 and chcr3, and cannot be modified. bit 17: am description 0 outputs dack during read cycle (initial value) 1 outputs dack during write cycle bit 16?acknowledge level (al): specifies whether to set dack (acknowledge) signal output to active high or active low. this bit is valid only with chcr0 and chcr1. it always reads as 0 for chcr2 and chcr3, and cannot be modified. bit 16: al description 0 active high output (initial value) 1 active low output
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 145 of 818 rej09b0273-0500 bits 15 and 14?destination address mode 1, 0 (dm1 and dm0): these bits specify increment/decrement of the dma transfer source address. these bit specifications are ignored when transferring data from an external device to address space in single address mode. bit 15: dm1 bit 14: dm0 description 0 0 destination address fixed (initial value) 0 1 destination address incremented (+1 during 8-bit transfer, +2 during 16-bit transfer, +4 during 32-bit transfer) 1 0 destination address decremented (?1 during 8-bit transfer, ?2 during 16-bit transfer, ?4 during 32-bit transfer) 1 1 setting prohibited bits 13 and 12?source address mode 1, 0 (sm1 and sm0): these bits specify increment/decrement of the dma transfer source address. these bit specifications are ignored when transferring data from an external device to address space in single address mode. bit 13: sm1 bit 12: sm0 description 0 0 source address fixed (initial value) 0 1 source address incremented (+1 during 8-bit transfer, +2 during 16-bit transfer, +4 during 32-bit transfer) 1 0 source address decremented (?1 during 8-bit transfer, ?2 during 16-bit transfer, ?4 during 32-bit transfer) 1 1 setting prohibited when the transfer source is specified at an indirect address, specify in source address register 3 (sar3) the actual storage address of the data you want to transfer as the data storage address (indirect address). during indirect address mode, sar3 obeys the sm1/sm0 setting for increment/decrement. in this case, sar3?s increment/decrement is fixed at +4/?4 or 0, irrespective of the transfer data size specified by ts1 and ts0.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 146 of 818 rej09b0273-0500 bits 11?8?resource select 3?0 (rs3?rs0): these bits specify the transfer request source. bit 11: rs3 bit 10: rs2 bit 9: rs1 bit 8: rs0 description 0 0 0 0 external request, dual address mode (initial value) 0 001prohibited 0 0 1 0 external request, single address mode. external address space external device. 0 0 1 1 external request, single address mode. external device external address space. 0 1 0 0 auto-request 0 101prohibited 0 1 1 0 atu, compare-match 6 (cmi6) 0 1 1 1 atu, input capture 0b (ici0b) 1 0 0 0 sci0 transmission 1 0 0 1 sci0 reception 1 0 1 0 sci1 transmission 1 0 1 1 sci1 reception 1 1 0 0 sci2 transmission 1 1 0 1 sci2 reception 1 110on-chip a/d0 1 111on-chip a/d1 note: external request designations are valid only for channels 0 and 1. no transfer request sources can be set for channels 2 or 3. bit 6? dreq dreq dreq dreq select (ds): sets the sampling method for the dreq pin in external request mode to either low-level detection or falling-edge detection. this bit is valid only with chcr0 and chcr1. for chcr2 and chcr3, this bit always reads as 0 and cannot be modified. even with channels 0 and 1, when specifying an on-chip peripheral module or autorequest as the transfer request source, this bit setting is ignored. the sampling method is fixed at falling-edge detection in cases other than auto-request. bit 6: ds description 0 low-level detection (initial value) 1 falling-edge detection
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 147 of 818 rej09b0273-0500 bit 5?transfer mode (tm): specifies the bus mode for data transfer. bit 5: tm description 0 cycle steal mode (initial value) 1burst mode bits 4 and 3?transfer size 1, 0 (ts1, ts0): specifies size of data for transfer. bit 4: ts1 bit 3: ts0 description 0 0 specifies byte size (8 bits) (initial value) 0 1 specifies word size (16 bits) 1 0 specifies longword size (32 bits) 1 1 prohibited bit 2?interrupt enable (ie): when this bit is set to 1, interrupt requests are generated after the number of data transfers specified in the dmatcr (when te = 1). bit 2: ie description 0 interrupt request not generated after dmatcr-specified transfer count (initial value) 1 interrupt request enabled on completion of dmatcr specified number of transfers bit 1?transfer end (te): this bit is set to 1 after the number of data transfers specified by the dmatcr. at this time, if the ie bit is set to 1, an interrupt request is generated. if data transfer ends before te is set to 1 (for example, due to an nmi or address error, or clearing of the de bit or dme bit of the dmaor) the te is not set to 1. with this bit set to 1, data transfer is disabled even if the de bit is set to 1. bit 1: te description 0 dmatcr-specified transfer count not ended (initial value) clear condition: 0 write after te = 1 read, power-on reset, standby mode 1 dmatcr specified number of transfers completed
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 148 of 818 rej09b0273-0500 bit 0?dmac enable (de): de enables operation in the corresponding channel. bit 0: de description 0 operation of the corresponding channel disabled (initial value) 1 operation of the corresponding channel enabled transfer mode is entered if this bit is set to 1 when auto-request is specified (rs3?rs0 settings). with an external request or on-chip module request, when a transfer request occurs after this bit is set to 1, transfer is enabled. if this bit is cleared during a data transfer, transfer is suspended. if the de bit has been set, but te = 1, then if the dme bit of the dmaor is 0, and the nmi or ae bit of the dmaor is 1, transfer enable mode is not entered. 9.2.5 dmac operation register (dmaor) the dmaor is a 16-bit read/write register that specifies the transfer mode of the dmac. bits 15?10 and bits 7?3 of this register always read as 0 and cannot be modified. register values are initialized to 0 by a power-on reset and in software standby mode. bit: 15 14 13 12 11 10 9 8 ??????pr1pr0 initial value:00000000 r/w:rrrrrrr/wr/w bit:76543210 ?????aenmifdme initial value:00000000 r/w:rrrrrr/(w) * r/(w) * r note: * 0 write only is valid after 1 is read at the ae and nmif bits.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 149 of 818 rej09b0273-0500 bits 9?8?priority mode 1 and 0 (pr1 and pr0): these bits determine the priority level of channels for execution when transfer requests are made for several channels simultaneously. bit 9: pr1 bit 8: pr0 description 0 0 ch0 > ch1 > ch2 > ch3 (initial value) 0 1 ch0 > ch2 > ch3 > ch1 1 0 ch2 > ch0 > ch1 > ch3 1 1 round robin mode bit 2?address error flag (ae): indicates that an address error has occurred during dma transfer. if this bit is set during a data transfer, transfers on all channels are suspended. the cpu cannot write a 1 to the ae bit. clearing is effected by 0 write after 1 read. bit 2: ae description 0 no address error, dma transfer enabled (initial value) clearing condition: write ae = 0 after reading ae = 1 1 address error, dma transfer disabled setting condition: address error due to dmac bit 1?nmi flag (nmif): indicates input of an nmi. this bit is set irrespective of whether the dmac is operating or suspended. if this bit is set during a data transfer, transfers on all channels are suspended. the cpu is unable to write a 1 to the nmif. clearing is effected by 0 write after 1 read. bit 1: nmif description 0 no nmi interrupt, dma transfer enabled (initial value) clearing condition: write nmif = 0 after reading nmif = 1 1 nmi has occurred, dmc transfer prohibited set condition: nmi interrupt occurrence bit 0?dmac master enable (dme): this bit enables activation of the entire dmac. when the dme bit and de bit of the chcr for the corresponding channel are set to 1, that channel is transfer-enabled. if this bit is cleared during a data transfer, transfers on all channels are suspended.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 150 of 818 rej09b0273-0500 even when the dme bit is set, when the te bit of the chcr is 1, or its de bit is 0, transfer is disabled in the case of an nmi of the dmaor or when ae = 1. bit 0: dme description 0 disable operation on all channels (initial value) 1 enable operation on all channels 9.3 operation when there is a dma transfer request, the dmac starts the transfer according to the predetermined channel priority order; when the transfer end conditions are satisfied, it ends the transfer. transfers can be requested in three modes: auto-request, external request, and on-chip peripheral module request. transfer can be in either the single address mode or the dual address mode, and dual address mode can be either direct or indirect address transfer mode. the bus mode can be either burst or cycle steal. 9.3.1 dma transfer flow after the dma source address registers (sar), dma destination address registers (dar), dma transfer count register (dmatcr), dma channel control registers (chcr), and dma operation register (dmaor) are set to the desired transfer conditions, the dmac transfers data according to the following procedure: 1. the dmac checks to see if transfer is enabled (de = 1, dme = 1, te = 0, nmif = 0, ae = 0). 2. when a transfer request comes and transfer has been enabled, the dmac transfers 1 transfer unit of data (determined by ts0 and ts1 setting). for an auto-request, the transfer begins automatically when the de bit and dme bit are set to 1. the dmatcr value will be decremented by 1 upon each transfer. the actual transfer flows vary by address mode and bus mode. 3. when the specified number of transfers have been completed (when dmatcr reaches 0), the transfer ends normally. if the ie bit of the chcr is set to 1 at this time, a dei interrupt is sent to the cpu. 4. when an address error occurs in the dmac or an nmi interrupt is generated, the transfer is aborted. transfers are also aborted when the de bit of the chcr or the dme bit of the dmaor are changed to 0.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 151 of 818 rej09b0273-0500 figure 9.2 is a flowchart of this procedure. normal end does nmif = 1, ae = 1, de = 0, or dme = 0? bus mode, transfer request mode, dreq detection selection system initial settings (sar, dar, tcr, chcr, dmaor) transfer (1 transfer unit); dmatcr ? 1 dmatcr, sar and dar updated dei interrupt request (when ie = 1) no yes no yes no yes yes no yes no * 3 * 2 start transfer aborted notes: 1. 2. 3. in auto-request mode, transfer begins when nmif, ae, and te are all 0, and the de and dme bits are set to 1. dreq = level detection in burst mode (external request) or cycle-steal mode. dreq = edge detection in burst mode (external request), or auto-request mode in burst mode. dmatcr = 0? transfer request occurs? * 1 de, dme = 1 and nmif, ae, te = 0? does nmif = 1, ae = 1, de = 0, or dme = 0? transfer ends figure 9.2 dmac transfer flowchart
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 152 of 818 rej09b0273-0500 9.3.2 dma transfer requests dma transfer requests are usually generated in either the data transfer source or destination, but they can also be generated by devices and on-chip peripheral modules that are neither the source nor the destination. transfers can be requested in three modes: auto-request, external request, and on-chip peripheral module request. the request mode is selected in the rs3 ? rs0 bits of the dma channel control registers 0 ? 3 (chcr0 ? chcr3). auto-request mode: when there is no transfer request signal from an external source, as in a memory-to-memory transfer or a transfer between memory and an on-chip peripheral module unable to request a transfer, the auto-request mode allows the dmac to automatically generate a transfer request signal internally. when the de bits of chcr0 ? chcr3 and the dme bit of the dmaor are set to 1, the transfer begins (so long as the te bits of chcr0 ? chcr3 and the nmif and ae bits of dmaor are all 0). external request mode: in this mode a transfer is performed at the request signal ( dreq ) of an external device. choose one of the modes shown in table 9.3 according to the application system. when this mode is selected, if the dma transfer is enabled (de = 1, dme = 1, te = 0, nmif = 0, ae = 0), a transfer is performed upon a request at the dreq input. choose to detect dreq by either the falling edge or low level of the signal input with the ds bit of chcr0 ? chcr3 (ds = 0 is level detection, ds = 1 is edge detection). the source of the transfer request does not have to be the data transfer source or destination. table 9.3 selecting external request modes with the rs bits rs3 rs2 rs1 rs0 address mode source destination 0 0 0 0 dual address mode any * any * 0 0 1 0 single address mode external memory or memory-mapped external device external device with dack 0 0 1 1 single address mode external device with dack external memory or memory-mapped external device note: * external memory, memory-mapped external device, on-chip memory, on-chip peripheral module (excluding dmac, dtc, bsc, ubc).
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 153 of 818 rej09b0273-0500 on-chip peripheral module request mode: in this mode a transfer is performed at the transfer request signal (interrupt request signal) of an on-chip peripheral module. as indicated in table 9.4, there are ten transfer request signals: five from the multifunction timer pulse unit (mtu), which are compare match or input capture interrupts; the receive data full interrupts (rxi) and transmit data empty interrupts (txi) of the two serial communication interfaces (sci); and the a/d conversion end interrupt (adi) of the a/d converter. when dma transfers are enabled (de = 1, dme = 1, te = 0, nmif = 0, ae = 0), a transfer is performed upon the input of a transfer request signal. the transfer request source need not be the data transfer source or transfer destination. however, when the transfer request is set by rxi (transfer request because sci ? s receive data is full), the transfer source must be the sci ? s receive data register (rdr). when the transfer request is set by txi (transfer request because sci ? s transmit data is empty), the transfer destination must be the sci ? s transmit data register (tdr). also, if the transfer request is set to the a/d converter, the data transfer destination must be the a/d converter register.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 154 of 818 rej09b0273-0500 table 9.4 selecting on-chip peripheral module request modes with the rs bits rs3 rs2 rs1 rs0 dmac transfer request source dmac transfer request signal transfer source transfer destination bus mode 0 1 1 0 atu compare-match 6 generation don ? t care * don ? t care * burst/cycle steal 1 atu input capture b generation don ? t care * don ? t care * burst/cycle steal 1 0 0 0 sci0 transmit block txi0 (sci0 transmit-data- empty transfer request) don ? t care * tdr0 burst/cycle steal 1sci0 receive block rxi0 (sci0 receive-data-full transfer request) rdr0 don ? t care * burst/cycle steal 1 0 sci1 transmit block txi1 (sci1 transmit-data- empty transfer request) don ? t care * tdr1 burst/cycle steal 1sci1 receive block rxi1 (sci1 receive-data-full transfer request) rdr1 don ? t care * burst/cycle steal 1 0 0 sci2 transmit block txi2 (sci2 transmit-data- empty transfer request) don ? t care * tdr2 burst/cycle steal 1sci2 receive block rxi2 (sci2 receive-data-full transfer request) rdr2 don ? t care * burst/cycle steal 1 0 a/d converter adi (a/d conversion end interrupt) addr0 don ? t care * burst/cycle steal 1 a/d converter adi (a/d conversion end interrupt) addr1 don ? t care * burst/cycle steal atu: advanced timer unit sci0, sci1, sci2: serial communication interface channels 0 ? 2 addr0, addr1: a/d converter channel 0 and 1 a/d registers note: * external memory, memory-mapped external device, on-chip memory, on-chip peripheral module (excluding dmac, bsc, and ubc)
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 155 of 818 rej09b0273-0500 in order to output a transfer request from an on-chip peripheral module, set the relevant interrupt enable bit for each module, and output an interrupt signal. when an on-chip peripheral module ? s interrupt request signal is used as a dma transfer request signal, interrupts for the cpu are not generated. when a dma transfer is conducted corresponding with one of the transfer request signals in table 9.4, it is automatically discontinued. in cycle steal mode this occurs in the first transfer, and in burst mode with the last transfer. 9.3.3 channel priority when the dmac receives simultaneous transfer requests on two or more channels, it selects a channel according to a predetermined priority order, either in a fixed mode or in round robin mode. these modes are selected by priority bits pr1 and pr0 in the dma operation register (dmaor). fixed mode: in these modes, the priority levels among the channels remain fixed. the following priority orders are available for fixed mode: ? ch0 > > > ? ch0 > > > ? ch2 > > > round robin mode: in round robin mode, each time the transfer of one transfer unit (byte, word or long word) ends on a given channel, that channel receives the lowest priority level (figure 9.3). the priority level in round robin mode immediately after a reset is ch0 > > >
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 156 of 818 rej09b0273-0500 ch1 > ch2 > ch3 > ch0 ch0 > ch1 > ch2 > ch3 ch2 > ch3 > ch0 > ch1 ch0 > ch1 > ch2 > ch3 ch2 > ch3 > ch0 > ch1 ch0 > ch1 > ch2 > ch3 ch0 > ch1 > ch2 > ch3 ch3 > ch0 > ch1 > ch2 ch0 > ch1 > ch2 > ch3 transfer on channel 0 initial priority setting initial priority setting initial priority setting initial priority setting no change in priority. when channel 2 receives the lowest priority, the priorities of channel 0 and 1, which were above channel 2, are also shifted simultaneously. immedi- ately thereafter, if there is a transfer request for channel 1 only, channel 1 is given the lowest priority, and the priorities of channels 3 and 0 are simultaneously shifted down. when channel 1 is given the lowest priority, the priority of channel 0, which was above channel 1, is also shifted simultaneously. channel 1 is given the lowest priority. priority after transfer priority after transfer priority after transfer priority after transfer priority after transfer due to issue of a transfer request for channel 1 only. transfer on channel 1 transfer on channel 2 transfer on channel 3 figure 9.3 round robin mode
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 157 of 818 rej09b0273-0500 figure 9.4 shows the example of changes in priority levels when transfer requests are issued simultaneously for channels 0 and 3, and channel 1 receives a transfer request during a transfer on channel 0. the dmac operates in the following manner under these circumstances: 1. transfer requests are issued simultaneously for channels 0 and 3. 2. since channel 0 has a higher priority level than channel 3, the channel 0 transfer is conducted first (channel 3 is on transfer standby). 3. a transfer request is issued for channel 1 during a transfer on channel 0 (channels 1 and 3 are on transfer standby). 4. at the end of the channel 0 transfer, channel 0 shifts to the lowest priority level. 5. at this point, channel 1 has a higher priority level than channel 3, so the channel 1 transfer comes first (channel 3 is on transfer standby). 6. when the channel 1 transfer ends, channel 1 shifts to the lowest priority level. 7. channel 3 transfer begins. 8. when the channel 3 transfer ends, channel 3 and channel 2 priority levels are lowered, giving channel 3 the lowest priority. transfer request channel waiting dmac operation channel priority issued for channels 0 and 3 issued for channel 1 0 > 1 > 2 > 3 channel 0 transfer begins 1 > 2 > 3 > 0 channel 0 transfer ends channel 1 transfer begins channel 3 transfer begins 2 > 3 > 0 > 1 channel 1 transfer ends 0 > 1 > 2 > 3 channel 3 transfer ends change of priority change of priority change of priority none 3 3 1.3 figure 9.4 example of changes in priority in round robin mode
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 158 of 818 rej09b0273-0500 9.3.4 dma transfer types the dmac supports the transfers shown in table 9.5. it can operate in the single address mode, in which either the transfer source or destination is accessed using an acknowledge signal, or dual address mode, in which both the transfer source and destination addresses are output. the dual address mode consists of a direct address mode, in which the output address value is the object of a direct data transfer, and an indirect address mode, in which the output address value is not the object of the data transfer, but the value stored at the output address becomes the transfer object address. the actual transfer operation timing varies with the bus mode. the dmac has two bus modes: cycle-steal mode and burst mode. table 9.5 supported dma transfers transfer destination transfer source external device with dack external memory memory- mapped external device on-chip memory on-chip peripheral module external device with dack not available single address mode single address mode not available not available external memory single address mode dual address mode dual address mode dual address mode dual address mode memory- mapped external device single address mode dual address mode dual address mode dual address mode dual address mode on-chip memory not available dual address mode dual address mode dual address mode dual address mode on-chip peripheral module not available dual address mode dual address mode dual address mode dual address mode note: the dual address mode includes direct address mode and indirect address mode.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 159 of 818 rej09b0273-0500 9.3.5 address modes single address mode: in the single address mode, both the transfer source and destination are external; one (selectable) is accessed by a dack signal while the other is accessed by an address. in this mode, the dmac performs the dma transfer in 1 bus cycle by simultaneously outputting a transfer request acknowledge dack signal to one external device to access it while outputting an address to the other end of the transfer. figure 9.5 shows a transfer between an external memory and an external device with dack in which the external device outputs data to the data bus while that data is written in external memory in the same bus cycle. dmac dack dreq external memory external device with dack superh microcomputer external address bus : data flow external data bus figure 9.5 data flow in single address mode two types of transfers are possible in the single address mode: (a) transfers between external devices with dack and memory-mapped external devices, and (b) transfers between external devices with dack and external memory. the only transfer requests for either of these is the external request ( dreq ). figure 9.6 shows the dma transfer timing for the single address mode.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 160 of 818 rej09b0273-0500 ck a21 ? a0 csn d15 ? d0 dack wrh wrl address output to external memory space data that is output from the external device with dack dack signal to external devices with dack (active low) wr signal to external memory space a. external device with dack to external memory space ck a21 ? a0 csn d15 ? d0 rd address output to external memory space data that is output from external memory space rd signal to external memory space dack signal to external device with dack (active low) dack b. external memory space to external device with dack figure 9.6 example of dma transfer timing in the single address mode 9.3.6 dual address mode dual address mode is used for access of both the transfer source and destination by address. transfer source and destination can be accessed either internally or externally. dual address mode is subdivided into two other modes: direct address transfer mode and indirect address transfer mode.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 161 of 818 rej09b0273-0500 direct address transfer mode: data is read from the transfer source during the data read cycle, and written to the transfer destination during the write cycle, so transfer is conducted in two bus cycles. at this time, the transfer data is temporarily stored in the dmac. with the kind of external memory transfer shown in figure 9.7, data is read from one of the memories by the dmac during a read cycle, then written to the other external memory during the subsequent write cycle. figure 9.8 shows the timing for this operation. data buffer address bus data bus address bus data bus memory transfer source module transfer destination module memory transfer source module transfer destination module sar dar data buffer sar dar the sar value is taken as the address, and data is read from the transfer source module and stored temporarily in the dmac. 1st bus cycle 1st bus cycle 2nd bus cycle 2nd bus cycle the dar value is taken as the address, and data stored in the dmac's data buffer is written to the transfer destination module. dmac dmac figure 9.7 direct address operation during dual address mode
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 162 of 818 rej09b0273-0500 data read cycle data write cycle transfer destination address transfer source address ck (1st cycle) (2nd cycle) a21 ? a0 csn d15 ? d0 rd wrh, wrl dack note: transfer between external memories with dack are output during read cycle. figure 9.8 direct address transfer timing in dual address mode
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 163 of 818 rej09b0273-0500 indirect address transfer mode: in this mode the memory address storing the data you actually want to transfer is specified in dmac internal transfer source address register (sar3). therefore, in indirect address transfer mode, the dmac internal transfer source address register value is read first. this value is stored once in the dmac. next, the read value is output as the address, and the value stored at that address is again stored in the dmac. finally, the subsequent read value is written to the address specified by the transfer destination address register, ending one cycle of dmac transfer. in indirect address mode (figure 9.9), transfer destination, transfer source, and indirect address storage destination are all 16-bit external memory locations, and transfer in this example is conducted in 16-bit or 8-bit units. timing for this transfer example is shown in figure 9.10. in indirect address mode, one nop cycle (figure 9.10) is required until the data read as the indirect address is output to the address bus. when transfer data is 32-bit, the third and fourth bus cycles each need to be doubled, giving a required total of six bus cycles and one nop cycle for the whole operation.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 164 of 818 rej09b0273-0500 sar3 dar3 data buffer address bus data bus memory transfer source module transfer destination module temporary buffer the sar value is taken as the address, memory data is read, and the value is stored in the temporary buffer. since the value read at this time is used as the address, it must be 32 bits. 2nd bus cycle 3rd bus cycle 4th bus cycle dmac sar3 dar3 data buffer address bus data bus memory transfer source module transfer destination module temporary buffer the value in the temporary buffer is taken as the address, and data is read from the transfer source module to the data buffer. sar3 dar3 data buffer address bus data bus memory transfer source module transfer destination module temporary buffer the dar3 value is taken as the address, and the value in the data buffer is written to the transfer destination module. note: memory, transfer source, and transfer destination modules are shown here. in practice, connection can be made anywhere there is address space. dmac dmac figure 9.9 dual address mode and indirect address operation
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 165 of 818 rej09b0273-0500 transfer source address (h) transfer source address (l) indirect address nop transfer destination address indirect address (h) indirect address (l) transfer data transfer data transfer data transfer data transfer data transfer source address ? 1 transfer source address ? 2 indirect address nop indirect address address read cycle (1st) (2nd) (3rd) nop cycle data read cycle (4th) data write cycle ck external memory space external memory space (external memory space has 16-bit width) a21 ? a0 csn d15 ? d0 internal address bus internal data bus dmac indirect address buffer dmac data buffer rd wrh , wrl notes: 1. 2. the internal address bus is controlled by the port and does not change. dmac does not fetch value until 32-bit data is read from the internal data bus. figure 9.10 dual address mode and indirect address transfer timing example 1
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 166 of 818 rej09b0273-0500 figure 9.11 shows an example of timing in indirect address mode when transfer source and indirect address storage locations are in internal memory, the transfer destination is an on-chip peripheral module with 2-cycle access space, and transfer data is 8-bit. since the indirect address storage destination and the transfer source are in internal memory, these can be accessed in one cycle. the transfer destination is 2-cycle access space, so two data write cycles are required. one nop cycle is required until the data read as the indirect address is output to the address bus. internal address bus internal data bus dmac indirect address buffer dmac data buffer ck internal memory space internal memory space transfer source address nop nop indirect address transfer destination address indirect address indirect address transfer data transfer data transfer data address read cycle nop cycle data read cycle data write cycle (4th) (1st) (2nd) (3rd) figure 9.11 dual address mode and indirect address transfer timing example 2
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 167 of 818 rej09b0273-0500 9.3.7 bus modes select the appropriate bus mode in the tm bits of chcr0 ? chcr3. there are two bus modes: cycle steal and burst. cycle-steal mode: in the cycle steal mode, the bus right is given to another bus master after each one-transfer-unit (byte, word, or longword) dmac transfer. when the next transfer request occurs, the bus rights are obtained from the other bus master and a transfer is performed for one transfer unit. when that transfer ends, the bus right is passed to the other bus master. this is repeated until the transfer end conditions are satisfied. the cycle steal mode can be used with all categories of transfer destination, transfer source and transfer request. figure 9.12 shows an example of dma transfer timing in the cycle steal mode. transfer conditions are dual address mode and dreq level detection. cpu cpu cpu dmac dmac cpu dmac dmac cpu cpu dreq bus cycle bus control returned to cpu read write write read figure 9.12 dma transfer timing example in the cycle-steal mode burst mode: once the bus right is obtained, the transfer is performed continuously until the transfer end condition is satisfied. in the external request mode with low level detection of the dreq pin, however, when the dreq pin is driven high, the bus passes to the other bus master after the bus cycle of the dmac that currently has an acknowledged request ends, even if the transfer end conditions have not been satisfied. figure 9.13 shows an example of dma transfer timing in the burst mode. transfer conditions are single address mode and dreq level detection. cpu cpu cpu dmac dmac dmac dmac dmac dreq bus cycle dmac cpu figure 9.13 dma transfer timing example in the burst mode
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 168 of 818 rej09b0273-0500 9.3.8 relationship between request modes and bus modes by dma transfer category table 9.6 shows the relationship between request modes and bus modes by dma transfer category. table 9.6 relationship of request modes and bus modes by dma transfer category address mode transfer category request mode bus * 6 mode transfer size (bits) usable channels single external device with dack and external memory external b/c 8/16/32 0,1 external device with dack and memory-mapped external device external b/c 8/16/32 0, 1 dual external memory and external memory any * 1 b/c 8/16/32 0 ? 3 * 5 external memory and memory-mapped external device any * 1 b/c 8/16/32 0 ? 3 * 5 memory-mapped external device and memory-mapped external device any * 1 b/c 8/16/32 0 ? 3 * 5 external memory and on-chip memory any * 1 b/c 8/16/32 0 ? 3 * 5 external memory and on-chip peripheral module any * 2 b/c * 3 8/16/32 * 4 0 ? 3 * 5 memory-mapped external device and on-chip memory any * 1 b/c 8/16/32 0 ? 3 * 5 memory-mapped external device and on-chip peripheral module any * 2 b/c * 3 8/16/32 * 4 0 ? 3 * 5 on-chip memory and on-chip memory any * 1 b/c 8/16/32 0 ? 3 * 5 on-chip memory and on-chip peripheral module any * 2 b/c * 3 8/16/32 * 4 0 ? 3 * 5 on-chip peripheral module and on- chip peripheral module any * 2 b/c * 3 8/16/32 * 4 0 ? 3 * 5 notes: 1. external request, auto-request or on-chip peripheral module request enabled. however, in the case of on-chip peripheral module request, it is not possible to specify the sci or a/d converter for the transfer request source. 2. external request, auto-request or on-chip peripheral module request possible. however, if transfer request source is also the sci or a/d converter, the transfer source or transfer destination must be the sci or a/d converter. 3. when the transfer request source is the sci, only cycle steal mode is possible. 4. access size permitted by register of on-chip peripheral module that is the transfer source or transfer destination. 5. when the transfer request is an external request, channels 0 and 1 only can be used. 6. b: burst, c: cycle steal
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 169 of 818 rej09b0273-0500 9.3.9 bus mode and channel priority order when a given channel is transferring in burst mode, and a transfer request is issued to channel 0, which has a higher priority ranking, transfer on channel 0 begins immediately. if the priority level setting is fixed mode (ch0 > > > > cpu dmac ch1 dmac ch1 dmac ch0 dmac ch1 dmac ch0 dmac ch1 dmac ch1 cpu ch0 ch1 ch0 dmac ch0 and ch1 round-robin mode dmac ch1 burst mode cpu cpu priority: round-robin mode ch0: cycle-steal mode ch1: burst mode dmac ch1 burst mode figure 9.14 bus handling when multiple channels are operating 9.3.10 number of bus cycle states and dreq dreq dreq dreq pin sample timing number of states in bus cycle: the number of states in the bus cycle when the dmac is the bus master is controlled by the bus state controller (bsc) just as it is when the cpu is the bus master. the bus cycle in the dual address mode is controlled by wait state control register 1 (wcr1) while the single address mode bus cycle is controlled by wait state control register 2 (wcr2). for details, see section 8.3.2, wait state control. dreq dreq dreq dreq pin sampling timing and drak signal: in external request mode, the dreq pin is sampled by either falling edge or low-level detection. when a dreq input is detected, a dmac bus cycle is issued and dma transfer effected, at the earliest, after three states. however, in burst mode when single address operation is specified, a dummy cycle is inserted for the first bus cycle. in this case, the actual data transfer starts from the second bus cycle. data is transferred
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 170 of 818 rej09b0273-0500 continuously from the second bus cycle. the dummy cycle is not counted in the number of transfer cycles, so there is no need to recognize the dummy cycle when setting the tcr. dreq sampling from the second time begins from the start of the transfer one bus cycle prior to the dmac transfer generated by the previous sampling. drak is output once for the first dreq sampling, irrespective of transfer mode or dreq detection method. in burst mode, using edge detection, dreq is sampled for the first cycle only, so drak is also output for the first cycle only. therefore, the dreq signal negate timing can be ascertained, and this facilitates handshake operations of transfer requests with the dmac. cycle steal mode operations: in cycle steal mode, dreq sampling timing is the same irrespective of dual or single address mode, or whether edge or low-level dreq detection is used. for example, dmac transfer begins (figure 9.15), at the earliest, three cycles from the first sampling timing. the second sampling begins at the start of the transfer one bus cycle prior to the start of the dmac transfer initiated by the first sampling (i.e., from the start of the cpu(3) transfer). at this point, if dreq detection has not occurred, sampling is executed every cycle thereafter. as in figure 9.16, whatever cycle the cpu transfer cycle is, the next sampling begins from the start of the transfer one bus cycle before the dmac transfer begins. figure 9.15 shows an example of output during dack read and figure 9.16 an example of output during dack write.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 171 of 818 rej09b0273-0500 ck d req drak bus cycle dack cpu(3) cpu(4) cpu(5) cpu(2) cpu(1) 1st sampling 2nd sampling dmac(r) dmac(r) dmac(w) dmac(w) dmac(w) dmac(r) figure 9.15 cycle steal, dual address and level detection (fastest operation)
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 172 of 818 rej09b0273-0500 ck dreq drak bus cycle dack cpu cpu cpu cpu dmac(r) dmac (r) dmac(w) 1st sampling 2nd sampling note: with cycle-steal and dual address operation, sampling timing is the same whether dreq detection is by level or by edge. figure 9.16 cycle steal, dual address and level detection (normal operation)
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 173 of 818 rej09b0273-0500 figures 9.17 and 9.18 show cycle steal mode and single address mode. in this case, transfer begins at earliest three cycles after the first dreq sampling. the second sampling begins from the start of the transfer one bus cycle before the start of the first dmac transfer. in single address mode, the dack signal is output during the dmac transfer period.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 174 of 818 rej09b0273-0500 ck dreq drak bus cycle dack cpu cpu cpu cpu cpu dmac dmac dmac figure 9.17 cycle steal, single address and level detection (fastest operation)
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 175 of 818 rej09b0273-0500 ck dreq drak bus cycle dack cpu cpu dmac cpu dmac cpu cpu figure 9.18 cycle steal, single address and level detection (normal operation)
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 176 of 818 rej09b0273-0500 burst mode, dual address, and level detection: dreq sampling timing in burst mode with dual address and level detection is virtually the same as that of cycle steal mode. for example, dmac transfer begins (figure 9.19), at the earliest, three cycles after the timing of the first sampling. the second sampling also begins from the start of the transfer one bus cycle before the start of the first dmac transfer. in burst mode, as long as transfer requests are issued, dmac transfer continues. therefore, the ? transfer one bus cycle before the start of the dmac transfer ? may be a dmac transfer. in burst mode, the dack output period is thesame as that of cycle steal mode. figure 9.20 shows the normal operation of this burst mode.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 177 of 818 rej09b0273-0500 ck dreq drak bus cycle dack cpu cpu cpu cpu dmac(r) dmac(w) dmac(r) dmac(r) dmac(w) dmac(r) dmac(w) figure 9.19 burst mode, dual address and level detection (fastest operation)
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 178 of 818 rej09b0273-0500 ck dreq drak bus cycle dack cpu cpu dmac(r) dmac(r) dmac(r) cpu dmac(w) dmac(w) figure 9.20 burst mode, dual address and level detection (normal operation)
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 179 of 818 rej09b0273-0500 burst mode, single address, and level detection: dreq sampling timing in burst mode with single address and level detection is shown in figures 9.21 and 9.22. in burst mode with single address and level detection, a dummy cycle is inserted as one bus cycle, at the earliest, three cycles after timing of the first sampling. data during this period is undefined, and the dack signal is not output. nor is the number of dmac transfers counted. the actual dmac transfer begins after one dummy bus cycle output. the dummy cycle is not counted either at the start of the second sampling (transfer one bus cycle before the start of the first dmac transfer). therefore, the second sampling is not conducted from the bus cycle starting the dummy cycle, but from the start of the cpu(3) bus cycle. thereafter, as long the dreq is continuously sampled, no dummy cycle is inserted. dreq sampling timing during this period begins from the start of the transfer one bus cycle before the start of dmac transfer, in the same way as with cycle steal mode. as with the four samplings in figure 9.21, once dmac transfer is interrupted, a dummy cycle is again inserted at the start as soon as dmac transfer is resumed. the dack output period in burst mode is the same as in cycle steal mode.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 180 of 818 rej09b0273-0500 ck dreq drak bus cycle dack cpu(4) cpu(1) cpu(2) cpu(3) dummy dmac dummy 2nd sampling 1st sampling 3rd sampling 4th sampling dmac dmac figure 9.21 burst mode, single address and level detection (fastest operation)
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 181 of 818 rej09b0273-0500 ck dreq drak bus cycle dack cpu cpu dummy dmac cpu dmac dmac figure 9.22 burst mode, single address and level detection (normal operation)
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 182 of 818 rej09b0273-0500 burst mode, dual address, and edge detection: in burst mode with dual address and edge detection, dreq sampling is conducted only on the first cycle. in figure 9.23, dmac transfer begins, at the earliest, three cycles after the timing of the first sampling. thereafter, dmac transfer continues until the end of the data transfer count set in the tcr. dreq sampling is not conducted during this period. therefore, drak is output on the first cycle only. when dmac transfer is resumed after being halted by a nmi or address error, be sure to reinput an edge request. the remaining transfer restarts after the first drak output. the dack output period in burst mode is the same as in cycle steal mode.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 183 of 818 rej09b0273-0500 ck dreq drak bus cycle dack cpu cpu cpu dmac(r) dmac(r) dmac(r) dmac(r) dmac(w) dmac(w) dmac(w) dmac(w) figure 9.23 burst mode, dual address and edge detection
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 184 of 818 rej09b0273-0500 burst mode, single address, and edge detection: in burst mode with single address and edge detection, dreq sampling is conducted only on the first cycle. in figure 9.24, a dummy cycle is inserted, at the earliest, three cycles after the timing for the first sampling. during this period, data is undefined, and dack is not output. nor is the number of dmac transfers counted. thereafter, dmac transfer continues until the data transfer count set in the tcr has ended. dreq sampling is not conducted during this period. therefore, drak is output on the first cycle only. when dmac transfer is resumed after being halted by a nmi or address error, be sure to reinput an edge request. drak is output once, and the remaining transfer restarts after output of one dummy cycle. the dack output period in burst mode is the same as in cycle steal mode.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 185 of 818 rej09b0273-0500 ck dreq drak bus cycle dack cpu dmac dmac dmac dmac cpu cpu dummy figure 9.24 burst mode, single address and edge detection
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 186 of 818 rej09b0273-0500 9.3.11 source address reload function channel 2 has a source address reload function. this returns to the first value set in the source address register (sar2) every four transfers by setting the ro bit of chcr2 to 1. figure 9.25 illustrates this operation. figure 9.26 is a timing chart for reload on mode, with burst mode, autorequest, 16-bit transfer data size, sar2 increment, and dar2 fixed mode. sar2 (initial value) dmac transfer request dmac control block reload control 4th count chcr2 dmatcr2 sar2 ro bit = 1 count signal reload signal reload signal address bus figure 9.25 source address reload function
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 187 of 818 rej09b0273-0500 ck internal address bus internal data bus sar2 dar2 dar2 dar2 dar2 sar2+2 sar2+4 sar2+6 sar2 dar2 sar2 data sar2+2 data sar2+4 data sar2+6 data sar2 data 1st channel 2 transfer 2nd channel 2 transfer 3rd channel 2 transfer 4th channel 2 transfer 5th channel 2 transfer sar2 output dar2 output sar2+2 output dar2 output sar2+4 output dar2 output sar2+6 output dar2 output sar2 output dar2 output after sar2+6 output, sar2 is reloaded bus right is returned one time in four figure 9.26 source address reload function timing chart the reload function can be executed whether the transfer data size is 8, 16, or 32 bits. dmatcr2, which specifies the number of transfers, is decremented by 1 at the end of every single-transfer-unit transfer, regardless of whether the reload function is on or off. therefore, when using the reload function in the on state, a multiple of 4 must be specified in dmatcr2. operation will not be guaranteed if any other value is set. also, the counter which counts the occurrence of four transfers for address reloading is reset by clearing of the dme bit in dmaor or the de bit in chcr2, setting of the transfer end flag (the te bit in chcr2), nmi input, and setting of the ae flag (address error generation in dmac transfer), as well as by a reset and in software standby mode, but sar2, dar2, dmatcr2, and other registers are not reset. consequently, when one of these sources occurs, there is a mixture of initialized counters and uninitialized registers in the dmac, and incorrect operation may result if a restart is executed in this state. therefore, when one of the above sources, other than te setting, occurs during use of the address reload function, sar, dar2, and dmatcr2 settings must be carried out before re- execution.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 188 of 818 rej09b0273-0500 9.3.12 dma transfer ending conditions the dma transfer ending conditions vary for individual channels ending and for all channels ending together. individual channel ending conditions: there are two ending conditions. a transfer ends when the value of the channel ? s dma transfer count register (tcr) is 0, or when the de bit of the channel ? s chcr is cleared to 0. ? when dmatcr is 0: when the dmatcr value becomes 0 and the corresponding channel's dma transfer ends, the transfer end flag bit (te) is set in the chcr. if the ie (interrupt enable) bit has been set, a dmac interrupt (dei) is requested of the cpu. ? when de of chcr is 0: software can halt a dma transfer by clearing the de bit in the channel ? s chcr. the te bit is not set when this happens. conditions for ending all channels simultaneously: transfers on all channels end when the nmif (nmi flag) bit or ae (address error flag) bit is set to 1 in the dmaor, or when the dme bit in the dmaor is cleared to 0. ? when the nmif or ae bit is set to 1 in dmaor: when an nmi interrupt or dmac address error occurs, the nmif or ae bit is set to 1 in the dmaor and all channels stop their transfers. the dmac obtains the bus rights, and if these flags are set to 1 during execution of a transfer, dmac halts operation when the transfer processing currently being executed ends, and transfers the bus right to the other bus master. consequently, even if the nmif or ae bits are set to 1 during a transfer, the dma source address register (sar), designation address register (dar), and transfer count register (tcr) are all updated. the te bit is not set. to resume the transfers after nmi interrupt or address error processing, clear the appropriate flag bit to 0. to avoid restarting a transfer on a particular channel, clear its de bit to 0. when the processing of a one unit transfer is complete. in a dual address mode direct address transfer, even if an address error occurs or the nmi flag is set during read processing, the transfer will not be halted until after completion of the following write processing. in such a case, sar, dar, and tcr values are updated. in the same manner, the transfer is not halted in dual address mode indirect address transfers until after the final write processing has ended. ? when dme is cleared to 0 in dmaor: clearing the dme bit to 0 in the dmaor aborts the transfers on all channels. the te bit is not set.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 189 of 818 rej09b0273-0500 9.3.13 dmac access from cpu the space addressed by the dmac is 3-cycle space. therefore, when the cpu becomes the bus master and accesses the dmac, a minimum of three basic clock (clk) cycles are required for one bus cycle. also, since the dmac is located in word space, while a word-size access to the dmac is completed in one bus cycle, a longword-size access is automatically divided into two word accesses, requiring two bus cycles (six basic clock cycles). these two bus cycles are executed consecutively; a different bus cycle is never inserted between the two word accesses. this applies to both write accesses and read accesses. 9.4 examples of use 9.4.1 example of dma transfer between on-chip sci and external memory in this example, on-chip serial communication interface channel 0 (sci0) received data is transferred to external memory using the dmac channel 3. table 9.7 indicates the transfer conditions and the setting values of each of the registers. table 9.7 transfer conditions and register set values for transfer between on-chip sci and external memory transfer conditions register value transfer source: rdr0 of on-chip sci0 sar0 h'ffff81a5 transfer destination: external memory dar0 h'00400000 transfer count: 64 times dmatcr0 h'00000040 transfer source address: fixed chcr0 h'00004905 transfer destination address: incremented transfer request source: sci0 (rdr0) bus mode: cycle steal transfer unit: byte interrupt request generation at end of transfer channel priority ranking: 0 > 1 > 2 > 3 dmaor h'0001
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 190 of 818 rej09b0273-0500 9.4.2 example of dma transfer between external ram and external device with dack in this example, an external request, serial address mode transfer with external memory as the transfer source and an external device with dack as the transfer destination is executed using dmac channel 1. table 9.8 indicates the transfer conditions and the setting values of each of the registers. table 9.8 transfer conditions and register set values for transfer between external ram and external device with dack transfer conditions register value transfer source: external ram sar1 h'00400000 transfer destination: external device with dack dar1 (access by dack) transfer count: 32 times dmatcr1 h'00000020 transfer source address: decremented chcr1 h'00002269 transfer destination address: (setting ineffective) transfer request source: external pin ( dreq1 ) edge detection bus mode: burst transfer unit: word no interrupt request generation at end of transfer channel priority ranking: 2 > 0 > 1 > 3 dmaor h'0201 9.4.3 example of dma transfer between a/d converter and internal memory (address reload on) in this example, the on-chip a/d converter channel 0 is the transfer source and internal memory is the transfer destination, and the address reload function is on. table 9.9 indicates the transfer conditions and the setting values of each of the registers.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 191 of 818 rej09b0273-0500 table 9.9 transfer conditions and register set values for transfer between a/d converter and internal memory transfer conditions register value transfer source: on-chip a/d converter ch1 (ad1) sar2 h'ffff85f0 transfer destination: internal memory dar2 h'ffffe800 transfer count: 128 times (reload count 32 times) dmatcr2 h'00000080 transfer source address: incremented chcr2 h'00085f21 transfer destination address: incremented transfer request source: a/d converter (ad1) bus mode: burst transfer unit: byte interrupt request generation at end of transfer channel priority ranking: 0 > 2 > 3 > 1 dmaor h'0101 when address reload is on, the sar value returns to its initially established value every four transfers. in the above example, when a transfer request is input from the a/d converter, the byte size data is first read in from the h'ffff85f0 register of ad1 and that data is written to the internal address h'ffffe800. because a byte size transfer was performed, the sar and dar values at this point are h'ffff85f1 and h'ffffe801, respectively. also, because this is a burst transfer, the bus rights remain secured, so continuous data transfer is possible. when four transfers are completed, if the address reload is off, execution continues with the fifth and sixth transfers and the sar value continues to increment from h'ffff85f3 to h'ffff85f4 to h'ffff85f5 and so on. however, when the address reload is on, the dmac transfer is halted upon completion of the fourth one and the bus right request signal to the cpu is cleared. at this time, the value stored in sar is not h'ffff85f3 to h'ffff85f4, but h'ffff85f3 to h'ffff85f0, a return to the initially established address. the dar value always continues to be decremented regardless of whether the address reload is on or off. the dmac internal status, due to the above operation after completion of the fourth transfer, is indicated in table 9.10 for both address reload on and off.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 192 of 818 rej09b0273-0500 table 9.10 dmac internal status item address reload on address reload off sar h'ffff83f0 h'ffff83f4 dar h'00400004 h'00400004 dmatcr h'0000007c h'0000007c bus rights released maintained dmac operation halted processing continues interrupts not issued not issued transfer request source flag clear executed not executed notes: 1. interrupts are executed until the dmatcr value becomes 0, and if the ie bit of the chcr is set to 1, are issued regardless of whether the address reload is on or off. 2. if transfer request source flag clears are executed until the dmatcr value becomes 0, they are executed regardless of whether the address reload is on or off. 3. designate burst mode when using the address reload function. there are cases where abnormal operation will result if it is executed in cycle steal mode. 4. designate a multiple of four for the tcr value when using the address reload function. there are cases where abnormal operation will result if anything else is designated. to execute transfers after the fifth one when the address reload is on, make the transfer request source issue another transfer request signal. 9.4.4 example of dma transfer between external memory and sci1 send side (indirect address on) in this example, dmac channel 3 is used, an indirect address designated external memory is the transfer source and the sci1 sending side is the transfer destination. table 9.11 indicates the transfer conditions and the setting values of each of the registers.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 193 of 818 rej09b0273-0500 table 9.11 transfer conditions and register set values for transfer between external memory and sci1 sending side transfer conditions register value transfer source: external memory sar3 h'00400000 value stored in address h'00400000 ? h'00450000 value stored in address h'00450000 ? h'55 transfer destination: on-chip sci tdr1 dar3 h'ffff81b3 transfer count: 10 times dmatcr3 h'0000000a transfer source address: incremented chcr3 h'00011801 transfer destination address: fixed transfer request source: sci1 (tdr1) bus mode: cycle steal transfer unit: byte interrupt request not generated at end of transfer channel priority ranking: 0 > 1 > 2 > 3 dmaor h'0001 when indirect address mode is on, the data stored in the address established in sar is not used as the transfer source data. in the case of indirect addressing, the value stored in the sar address is read, then that value is used as the address and the data read from that address is used as the transfer source data, then that data is stored in the address designated by the dar. in the table 9.11 example, when a transfer request from the tdr1 of sci1 is generated, a read of the address located at h'00400000, which is the value set in sar3, is performed first. the data h'00450000 is stored at this h'00400000 address, and the dmac first reads this h'00450000 value. it then uses this read value of h'00450000 as an address and reads the value of h'55 that is stored in the h'00450000 address. it then writes the value h'55 to the address h'ffff81b3 designated by dar3 to complete one indirect address transfer. with indirect addressing, the first executed data read from the address established in sar3 always results in a longword size transfer regardless of the ts0, ts1 bit designations for transfer data size. however, the transfer source address fixed and increment or decrement designations are as according to the sm0, sm1 bits. consequently, despite the fact that the transfer data size designation is byte in this example, the sar3 value at the end of one transfer is h'00400004. the write operation is exactly the same as an ordinary dual address transfer write operation.
section 9 direct memory access controller (dmac) rev. 5.00 jan 06, 2006 page 194 of 818 rej09b0273-0500 9.5 cautions on use 1. access is possible regardless of the dma channel control register (chcr0 to chcr3) data size. other than the dma operation register (dmaor) accessing in byte (8 bit) or word (16 bit) units, access all registers in word (16 bit) or longword (32 bit) units. 2. when rewriting the rs0 ? rs3 bits of chcr0 ? chcr3, first clear the de bit to 0 (set the de bit to 0 before doing rewrites with a chcr byte address). 3. when an nmi interrupt is input, the nmif bit of the dmaor is set even when the dmac is not operating. 4. set the dme bit of the dmaor to 0 and make certain that any dmac received transfer request processing has been completed before entering standby mode. 5. do not access the dmac, dtc, bsc, or ubc on-chip peripheral modules from the dmac. 6. when activating the dmac, do the chcr or dmaor setting as the final step. there are instances where abnormal operation will result if any other registers are established last. 7. after the dmatcr count becomes 0 and the dma transfer ends normally, always write a 0 to the tcr, even when executing the maximum number of transfers on the same channel. there are instances where abnormal operation will result if this is not done. 8. designate burst mode as the transfer mode when using the address reload function. there are instances where abnormal operation will result in cycle steal mode. 9. designate a multiple of four for the tcr value when using the address reload function. there are instances where abnormal operation will result if anything else is designated. 10. when detecting external requests by falling edge, maintain the external request pin at high level when performing the dmac establishment. 11. when operating in single address mode, establish an external address as the address. there are instances where abnormal operation will result if an internal address is established. 12. do not access dmac register empty addresses (h'ffff86b2 to h'ffff86bf). operation cannot be guaranteed when empty addresses are accessed. 13. if dmac transfer is aborted by nmi or ae setting, or dme or de2 clearing, during dmac execution with address reload on, the sar2, dar2, and dmatcr2 settings should be made before reexecuting the transfer. the dmac will not operate correctly if this is not done.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 195 of 818 rej09b0273-0500 section 10 advanced timer unit (atu) 10.1 overview the sh7050 series has an on-chip advanced timer unit (atu) with one 32-bit timer channel and nine 16-bit timer channels. 10.1.1 features atu features are summarized below. ? capability to process up to 34 pulse inputs and outputs ? prescaler ? input clock to channel 0 scaled in 1 stage, input clock to channels 1 to 9 scaled in 2 stages ? 1/1 to 1/32 clock scaling possible in initial stage for all channels ? 1/1, 1/2, 1/4, 1/8, 1/16, or 1/32 scaling possible in second stage for channels 1 to 10 ? external clock tclka, tclkb selection also possible for channels 1 to 5 ? channel 0 has four 32-bit input capture lines, allowing the following operations: ? rising-edge, falling-edge, or both-edge detection selectable ? channel 1 compare-match can be used as capture signal (trg1a) (icr0a, icr0d only) ? interrupt can be generated by trigger input ? interval interrupt generation function generates four interval interrupts as selected ? channels 1 and 2 have a total of eight 16-bit input capture/output compare registers and one dedicated input capture register. the 16-bit output compare registers can also be selected for channel 10 one-shot pulse offset. ? waveform output by means of compare-match: selection of 0 output, 1 output, or toggle output ? input capture function: rising-edge, falling-edge, or both-edge detection osbr trigger source is channel 0 capture set to 1 (trg0a) ? eight counter overflow interrupts/compare-match interrupts/capture interrupts can be generated (channel 1/a?f, channel 2/a, b) ? compare-match signal (trg1a) can be sent from channel 1 to channel 0 as a trigger ? compare-match signal can be sent from channel 2 to the advanced pulse controller (apc) ? channels 3 to 5 have a total of ten 16-bit input capture/output compare/pwm registers (ten inputs/outputs when using input capture/output compare, seven outputs when using pwm), allowing the following operations: ? selection of input capture, output compare, pwm mode
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 196 of 818 rej09b0273-0500 ? waveform output by means of compare-match: selection of 0 output, 1 output, or toggle output ? input capture function: rising-edge, falling-edge, or both-edge detection ? ten compare-match interrupts/capture interrupts (channel 3/a?d, channel 4/a?d, channel 5/a, b) and three counter overflow interrupts can be generated ? channels 6 to 9 have four pwm outputs, allowing the following operations: ? any cycle and duty from 0 to 100% can be set ? duty buffer register, with transfer to duty register every cycle ? interrupts can be generated every cycle ? channel 10 has eight 16-bit down-counters for one-shot pulse output, allowing the following operations: ? one-shot pulse generation by down-counter ? down-counter can be rewritten during count ? interrupt can be generated at end of down-count ? offset one-shot pulse function available ? high-speed access to internal 16-bit bus ? high-speed access to 16-bit bus for 16-bit registers: timer counters, compare registers, and capture registers ? 44 interrupt sources ? four input capture and one overflow interrupt request for channel 0 ? four interval interrupt requests ? eight dual input capture/compare-match interrupt requests and two counter overflow interrupt requests for channels 1 and 2 ? ten dual input capture/compare-match interrupt requests and three overflow interrupt requests for channels 3 to 5 ? four cycle interrupts for channels 6 to 9 ? eight underflow interrupts for channel 10 ? direct memory access controller (dmac) activation ? the dmac can be activated by a channel 0 input capture interrupt (ici0b) ? the dmac can be activated by a channel 6 cycle register 6 compare-match interrupt (cmi6) ? a/d converter activation ? the a/d converter can be activated by detection of 1 in bits 10 to 13 of the channel 0 free- running counter (tcnt0)
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 197 of 818 rej09b0273-0500 table 10.1 lists the functions of the atu. table 10.1 atu functions item channel 0 channel 1 channel 2 channels 3?5 channels 6?9 channel 10 counter configura- tion clock sources ? /32 ( ? /32) (1/2 n ) (n = 0?5) tclka, tclkb ( ? /32) (1/2 n ) (n = 0?5) tclka, tclkb ( ? /32) (1/2 n ) (n = 0?5) tclka, tclkb ( ? /32) (1/2 n ) (n = 0?5) ( ? /32) (1/2 n ) (n = 0?5) counters tcnt0h, tcnt0l tcnt1 tcnt2 tcnt3, tcnt4, tcnt5 tcnt6, tcnt7, tcnt8, tcnt9 dcnt10a, dcnt10b, dcnt10c, dcnt10d, dcnt10e, dcnt10f, dcnt10g, dcnt10h register configu- ration general registers ?gr1a, gr1b, gr1c, gr1d, gr1e, gr1f gr2a, gr2b gr3a?3d, gr4a?4d, gr5a, gr5b ?? dedicated input capture icr0ah, icr0al, icr0bh, icr0bl, icr0ch, icr0cl, icr0dh, icr0dl osbr???? pwm output ???? cylr6?9, dtr6?9, bfr6?9 ? input pins tia0, tib0, tic0, tid0 ????? i/o pins ? tioa1, tiob1, tioac, tiod1, tioe1, tiof1 tioa2, tiob2 tioa3? tiod3, tioa4? tiod4, tioa5, tiob5 ??
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 198 of 818 rej09b0273-0500 item channel 0 channel 1 channel 2 channels 3?5 channels 6?9 channel 10 output pins ? ? ? ? to6?to9 toa10, tob10, toc10, tod10, toe10, tof10, tog10, toh10 counter clearing function ???o o ? interrupt sources 9 sources  input capture 0a  input capture 0b  input capture 0c  input capture 0d overflow 0  interval 0 *  interval 1 *  interval 2 *  interval 3 * ( * same vector) 7 sources  dual input capture/ compare- match 1a  dual input capture/ compare- match 1b  dual input capture/ compare- match 1c  dual input capture/ compare- match 1d  dual input capture/ compare- match 1e  dual input capture/ compare- match 1f overflow 1 3 sources  dual input capture/ compare- match 2a  dual input capture/ compare- match 2b overflow 2 13 sources  dual input capture/ compare- match 3a?5a  dual input capture/ compare- match 3b?5b  dual input capture/ compare- match 3c?4c  dual input capture/ compare- match 3d?4d overflow 3?5 1 source each (total 4 sources)  cycle compare- match (cmi6? cmi9) 8 sources  underflow osf10a osf10b osf10c osf10d osf10e osf10f osf10g osf10h
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 199 of 818 rej09b0273-0500 item channel 0 channel 1 channel 2 channels 3?5 channels 6?9 channel 10 inter-channel and inter-module connection signals trigger output of input capture signal to channel 1 trigger output of compare- match signal to channel 1 a/d converter activation signal output output of activation input capture signal to dmac trigger output of compare- match signal to channel 10 one-shot pulse output down- counter trigger output of compare- match signal to channel 0 trigger output of compare- match signal to channel 10 one-shot pulse output down- counter compare- match signal output to apc (advanced pulse controller) ? output of activation compare- match signal to dmac trigger output of channel 1 & 2 compare- match signals to one-shot pulse output down- counter o: available ?: not available
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 200 of 818 rej09b0273-0500 10.1.2 block diagrams overall block diagram atu block diagram: figure 10.1 shows an overall block diagram of the atu. ic/oc control i/o interrupt control counter and register control, and comparator tclka tclkb interrupts inter-module connection signals external pins inter-module address bus prescaler clock selection module data bus inter-module data bus 32-bit timer channel 0 16-bit timer channel 1 16-bit timer channel 9 16-bit timer channel 10 tstr bus interface legend: tstr: timer start register (16 bits) interrupts: itv0 ? itv3, ov10 ? ov15, ic10a ? ic10d, imi1a ? imi1f, imi2a, imi2b, imi3a ? imi3d, imi4a ? imi4d, imi5a, imi5b, cmi6 ? cmi9, osi10a ? osi10h external pins: tia0 ? tid0, tioa1 ? tiof1, tioa2, tioib2, tioa3 ? tiod3, tioa4 ? tiod3, tioa5, tiob5, to6 ? to9, toa10 ? toh10 inter-module connection signals: signals to a/d converter, signals to direct memory access controller (dmac), signals to advanced pulse controller (apc) . . . . . . . . figure 10.1 overall block diagram of atu
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 201 of 818 rej09b0273-0500 block diagram of channel 0: figure 10.2 shows a block diagram of atu channel 0. clock selection tgsr control irqer control control logic tstr ovi0 itv ici0a ici0b ici0c ici0d tia0 tib0 tic0 tid0 trg1a /m 1 m 32 legend: tstr: timer start register (16 bits) tior0a: timer i/o control register 0a (8 bits) tgsr: trigger selection register (8 bits) tsra: timer status register a (8 bits) tiera: timer interrupt enable register a (8 bits) itvrr: interval interrupt request register (8 bits) tcnt0: free-running counter 0 (16 bits) icr0: input capture register 0 (16 bits) interrupts: ovi0: overflow interrupt 0 itv: interval interrupt ici0: input capture interrupt 0 inter-channel connection signal: trg1a: channel 1/gr1a compare-match signal tior0a tgsr tsrah tsral tiera itvrr tcnt0h tcnt0l icr0ah icr0al icr0bh icr0bl icr0ch icr0ch icr0dh icr0dl module data bus figure 10.2 block diagram of channel 0
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 202 of 818 rej09b0273-0500 block diagram of channel 1: figure 10.3 shows a block diagram of atu channel 1. clock selection comparator control logic tstr tclka tclkb off1a ? 1f ovi1 imia imib imic imid imie imif /(m 2 n ) module data bus tioa1 tiob1 tioc1 tiod1 tioe1 tiof1 trg0a trg1a 1 m 32 0 n 5 legend: tstr: timer start register (16 bits) tcr1: timer control register 1 (8 bits) tior1: timer i/o control register 1 (8 bits) tsrb: timer status register b (8 bits) interrupts: ovi1: overflow interrupt 1 imi1: input capture/compare-match interrupt 1 inter-channel connection signals: off1: offset compare-match signal trg0a: channel 0/icr0a input signal trg1a: channel 1/gr1a compare-match signal tierb: timer interrupt enable register b (8 bits) tcnt1: free-running counter 1 (16 bits) gr1: general register 1 (16 bits) osbr: offset base register (16 bits) tcr1 tior1a tior1b tior1c tsrb tierb tcnt1 gr1a gr1b gr1c gr1d gr1e gr1f osbr figure 10.3 block diagram of channel 1
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 203 of 818 rej09b0273-0500 block diagram of channel 2: figure 10.4 shows a block diagram of atu channel 2. tstr tclka tclkb off2a ? 2b apchigh apclow /(m 2 n ) module data bus ovi2 imi2a imi2b tioa2 tiob2 1 m 32 0 n 5 clock selection comparator control logic legend: tstr: timer start register (16 bits) tcr2: timer control register 2 (8 bits) tior2a: timer i/o control register 2 (8 bits) tsrc: timer status register c (8 bits) tierc: timer interrupt enable register c (8 bits) tcnt2: free-running counter 2 (16 bits) gr2: general register 2 (16 bits) interrupts: ovi2: overflow interrupt 2 imi2: input capture/compare-match interrupt 2 inter-channel connection signal: off2: offset compare-match signal inter-module connection signals: apchigh: gr2b compare-match signal apclow: gr2a compare-match signal tcr2 tior2a tsrc tierc tcnt2 gr2a gr2b figure 10.4 block diagram of channel 2
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 204 of 818 rej09b0273-0500 block diagram of channels 3 and 4: figure 10.5 shows a block diagram of atu channels 3 and 4. tstr tclka tclkb /(m 2 n ) ovi3/4 imi3a/4a imi3b/4b imi3c/4c imi3d/4d tioa3/4 tiob3/4 tioc3/4 tiod3/4 1 m 32 0 n 5 clock selection comparator control logic module data bus legend: tstr: timer start register (16 bits) tmdr: timer mode register (8 bits) tcr: timer control register (8 bits) tior: timer i/o control register (8 bits) tsrd: timer status register d (8 bits) tierd: timer interrupt enable register d (8 bits) tcnt: free-running counter (16 bits) gr: general register (16 bits) interrupts: ovi: overflow interrupt imi: input capture/compare-match interrupt note: * tmdr is used by channels 3 to 5. tsrdh and tierdh are used by channel 3. tsrdl and tierdl are used by channels 4 and 5. tmdr * tcr3/4 tior3a/4a tior3b/4b tsrdh/l * tierdh/l * tcnt3/4 gr3a/4a gr3b/4b gr3c/4c gr3d/4d figure 10.5 block diagram of channels 3 and 4
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 205 of 818 rej09b0273-0500 block diagram of channel 5: figure 10.6 shows a block diagram of atu channel 5. tstr tclka tclkb /(m 2 n ) ovi5 imi5a imi5b tioa5 tiob5 1 m 32 0 n 5 clock selection comparator control logic module data bus legend: tstr: timer start register (16 bits) tmdr: timer mode register (8 bits) tcr5: timer control register 5 (8 bits) tior5a: timer i/o control register 5a (8 bits) tsrdl: timer status register dl (8 bits) tierdl: timer interrupt enable register dl (8 bits) tcnt5: free-running counter 5 (16 bits) gr5: general register 5 (16 bits) interrupts: ovi5: overflow interrupt 5 imi5: input capture/compare-match interrupt 5 note: * tmdr is used by channels 3 to 5. tsrdh and tierdh are used by channels 4 and 5. tmdr * tcr5 ctior5a tsrdl * tierdl * tcnt5 gr5a gr5b figure 10.6 block diagram of channel 5
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 206 of 818 rej09b0273-0500 block diagram of channels 6 to 9: figure 10.7 shows a block diagram of atu channels 6 to 9. tstr /(m 2 n ) cmi6 ? 9 to6 ? 9 legend: tcr: timer control register (8 bits) tsre: timer status register e (8 bits) tiere: timer interrupt enable register e (8 bits) tcnt: free-running counter (16 bits) cylr: cycle register (16 bits) bfr: buffer register (16 bits) dtr: duty register (16 bits) interrupt: cmi: cycle compare-match interrupt clock selection comparator control logic module data bus 1 m 32 0 n 5 tcr6 ? 9 tsre tiere tcnt6 ? 9 cylr6 ? 9 bfr6 ? 9 dtr6 ? 9 figure 10.7 block diagram of channels 6 to 9
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 207 of 818 rej09b0273-0500 block diagram of channel 10: figure 10.8 shows a block diagram of atu channel 10. off1a ? f off2a ? b /(m 2 n ) osi10a ? h toa10 tob10 toc10 tod10 toe10 tof10 tog10 toh10 clock selection comparator control logic 1 m 32 0 n 5 module data bus legend: tcr10: timer control register 10 (8 bits) tierf: timer interrupt enable register f (8 bits) tsrf: timer status register f (8 bits) dstr: down-count start register (8 bits) tcnr: timer connection register (8 bits) dcnt10: down-counter 10 (16 bits) interrupt: osi10: one-shot pulse interrupt 10 inter-channel connection signal: off: offset compare-match signal tcr10 tierf tsrf dstr tcnr dcnt10a dcnt10b dcnt10c dcnt10d dcnt10e dcnt10f dcnt10g dcnt10h figure 10.8 block diagram of channel 10
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 208 of 818 rej09b0273-0500 10.1.3 inter-channel and inter-module signal connection diagram channel 10.9 shows the connections between channels and between modules in the atu. icr0ah tia0 tib0 tic0 tid0 mux tcnt0h tcnt1 tcnt2 tcnt6 tcnt0l a/d converter activation ( ? 1 ? detection) tcnt0 channel 0 internal clk internal clk tclka tclkb internal clk tclka tclkb internal clk channel 1 channel 2 channel 6 channel 10 offset compare- match signal down-counters dmac activation (input capture) dmac activation (compare- match) trg0a trigger output (synchronous capture) icr0bh icr0ch icr0dh gr1a trg1a trigger output (compare-match) gr1b gr1c gr1f osbr gr1e gr1d dcnt10a off1a off1b off1c off1d off1e off1f off2a off2b toa10 to6 tiob2 tioa2 tiof1 trigger input compare-match signal transmission to advanced pulse controller (apc) tioe1 tiod1 tioc1 tiob1 tioa1 tob10 toc10 tod10 toe10 tof10 tog10 toh10 dcnt10b dcnt10c dcnt10f dcnt10g dcnt10h dcnt10e dcnt10d gr2a gr2b cylr6 dtr6 bfr6 icr0al icr0bl icr0cl icr0dl mux mux mux figure 10.9 inter-channel and inter-module signal connection diagram
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 209 of 818 rej09b0273-0500 10.1.4 prescaler diagram figure 10.10 shows the first and second prescaler stages in the atu. the output of the first prescaler stage is input to channel 0. either the output of the second prescaler stage or an external clock can be input to channels 1 to 10, and an additional external clock (tclka or tclkb) can be input to channels 1 to 5. second prescaler stage setting register channel 1 tcr1 channel 2 tcr2 channel 3 tcr3 channel 4 tcr4 channel 5 tcr5 channel 6 channel 7 tcr7 channel 8 tcr8 channel 9 dcnt10a ? dcnt10f dcnt10g, dcnt10h tcr9 channel 10 channel 10 tcr10 channel 0 pscr1 ' = ? /m 1 m 32 ' = /m (1 m 32) " = '/2 n (0 n 5) or external clock " = '/2 n (0 n 5) tcr6 first prescaler stage setting register input clock " or external clock " or external clock " or external clock " or external clock " or external clock " " " " " settable prescaler values ' figure 10.10 prescaler diagram
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 210 of 818 rej09b0273-0500 10.1.5 pin configuration table 10.2 shows the pin configuration of the atu. when these external pin functions are used, the pin function controller (pfc) should also be set in accordance with the atu settings. for details, see section 16, pin function controller. table 10.2 atu pins channel name abbreviation i/o function common clock input a tclka input external clock a input pin clock input b tclkb input external clock b input pin 0 input capture a0 tia0 input icr0a input capture input pin input capture b0 tib0 input icr0b input capture input pin input capture c0 tic0 input icr0c input capture input pin input capture d0 tid0 input icr0d input capture input pin 1 input capture/output compare a1 tioa1 input/ output gr1a output compare output/gr1a input capture input input capture/output compare b1 tiob1 input/ output gr1b output compare output/gr1b input capture input input capture/output compare c1 tioc1 input/ output gr1c output compare output/gr1c input capture input input capture/output compare d1 tiod1 input/ output gr1d output compare output/gr1d input capture input input capture/output compare e1 tioe1 input/ output gr1e output compare output/gr1e input capture input input capture/output compare f1 tiof1 input/ output gr1f output compare output/gr1f input capture input 2 input capture/output compare a2 tioa2 input/ output gr2a output compare output/gr2a input capture input input capture/output compare b2 tiob2 input/ output gr2b output compare output/gr2b input capture input 3 input capture/output compare a3 tioa3 input/ output gr3a output compare output/gr3a input capture input/pwm output pin (pwm mode) input capture/output compare b3 tiob3 input/ output gr3b output compare output/gr3b input capture input/pwm output pin (pwm mode)
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 211 of 818 rej09b0273-0500 channel name abbreviation i/o function 3 input capture/output compare c3 tioc3 input/ output gr3c output compare output/gr3c input capture input/pwm output pin (pwm mode) input capture/output compare d3 tiod3 input/ output gr3d output compare output/gr3d input capture input 4 input capture/output compare a4 tioa4 input/ output gr4a output compare output/gr4a input capture input/pwm output pin (pwm mode) input capture/output compare b4 tiob4 input/ output gr4b output compare output/gr4b input capture input/pwm output pin (pwm mode) input capture/output compare c4 tioc4 input/ output gr4c output compare output/gr4c input capture input/pwm output pin (pwm mode) input capture/output compare d4 tiod4 input/ output gr4d output compare output/gr4d input capture input 5 input capture/output compare a5 tioa5 input/ output gr5a output compare output/gr5a input capture input/pwm output pin (pwm mode) input capture/output compare b5 tiob5 input/ output gr5b output compare output/gr5b input capture input 6 output compare 6 to6 output channel 6 pwm output pin 7 output compare 7 to7 output channel 7 pwm output pin 8 output compare 8 to8 output channel 8 pwm output pin 9 output compare 9 to9 output channel 9 pwm output pin 10 one-shot pulse a10 toa10 output one-shot pulse output pin one-shot pulse b10 tob10 output one-shot pulse output pin one-shot pulse c10 toc10 output one-shot pulse output pin one-shot pulse d10 tod10 output one-shot pulse output pin one-shot pulse e10 toe10 output one-shot pulse output pin one-shot pulse f10 tof10 output one-shot pulse output pin one-shot pulse g10 tog10 output one-shot pulse output pin one-shot pulse h10 toh10 output one-shot pulse output pin
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 212 of 818 rej09b0273-0500 10.1.6 register and counter configuration table 3 summarizes the atu registers. table 10.3 atu registers channel name abbrevia- tion r/w initial value address access size common prescaler register 1 pscr1 r/w h'00 h'ffff82e9 8 bits timer start register tstr r/w h'0000 h'ffff82ea 16 bits 0 trigger selection register tgsr r/w h'00 h'ffff8280 8 bits timer i/o control register 0a tior0a r/w h'00 h'ffff8281 8 bits interval interrupt request register itvrr r/w h'00 h'ffff8282 8 bits timer status register ah tsrah r/(w) * 1 h'00 h'ffff8283 8 bits timer interrupt enable register a tiera r/w h'00 h'ffff8284 8 bits timer status register al tsral r/(w) * 1 h'00 h'ffff8285 8 bits free-running counter 0h tcnt0h r/w h'0000 h'ffff8288 32 bits free-running counter 0l tcnt0l r/w h'0000 input capture register 0ah icr0ah r h'0000 h'ffff828c 32 bits input capture register 0al icr0al r h'0000 input capture register 0bh icr0bh r h'0000 h'ffff8290 32 bits input capture register 0bl icr0bl r h'0000 input capture register 0ch icr0ch r h'0000 h'ffff8294 32 bits input capture register 0cl icr0cl r h'0000 input capture register 0dh icr0dh r h'0000 h'ffff8298 32 bits input capture register 0dl icr0dl r h'0000 1 timer control register 1 tcr1 r/w h'00 h'ffff82c0 8 bits 16 bits timer i/o control register 1a tior1a r/w h'00 h'ffff82c1 8 bits timer i/o control register 1b tior1b r/w h'00 h'ffff82c2 8 bits 16 bits timer i/o control register 1c tior1c r/w h'00 h'ffff82c3 8 bits timer interrupt enable register b tierb r/w h'00 h'ffff82c4 8 bits timer status register b tsrb r/(w) * 1 h'00 h'ffff82c5 8 bits free-running counter 1 tcnt1 r/w h'0000 h'ffff82d0 16 bits
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 213 of 818 rej09b0273-0500 channel name abbrevia- tion r/w initial value address access size 1 general register 1a gr1a r/w h'ffff h'ffff82d2 16 bits general register 1b gr1b r/w h'ffff h'ffff82d4 16 bits general register 1c gr1c r/w h'ffff h'ffff82d6 16 bits general register 1d gr1d r/w h'ffff h'ffff82d8 16 bits general register 1e gr1e r/w h'ffff h'ffff82da 16 bits general register 1f gr1f r/w h'ffff h'ffff82dc 16 bits offset base register osbr r h'0000 h'ffff82de 16 bits 2 timer control register 2 tcr2 r/w h'00 h'ffff82c6 8 bits 16 bits timer i/o control register 2a tior2a r/w h'00 h'ffff82c7 8 bits timer interrupt enable register c tierc r/w h'00 h'ffff82c8 8 bits timer status register c tsrc r/(w) * 1 h'00 h'ffff82c9 8 bits free-running counter 2 tcnt2 r/w h'0000 h'ffff82ca 16 bits general register 2a gr2a r/w h'ffff h'ffff82cc 16 bits general register 2b gr2b r/w h'ffff h'ffff82ce 16 bits 3 ? 5 timer mode register tmdr r/w h'00 h'ffff8200 8 bits timer interrupt enable register dh tierdh r/w h'00 h'ffff8202 8 bits timer status register dh tsrdh r/(w) * 1 h'00 h'ffff8203 8 bits timer interrupt enable register dl tierdl r/w h'00 h'ffff8204 8 bits timer status register dl tsrdl r/(w) * 1 h'00 h'ffff8205 8 bits 3 timer i/o control register 3a tior3a r/w h'00 h'ffff8208 8 bits 16 bits timer i/o control register 3b tior3b r/w h'00 h'ffff8209 8 bits free-running counter 3 tcnt3 r/w h'0000 h'ffff820e 16 bits general register 3a gr3a r/w h'ffff h'ffff8210 16 bits general register 3b gr3b r/w h'ffff h'ffff8212 16 bits general register 3c gr3c r/w h'ffff h'ffff8214 16 bits general register 3d gr3d r/w h'ffff h'ffff8216 16 bits timer control register 3 tcr3 r/w h'00 h'ffff8206 8 bits 16 bits 4 timer control register 4 tcr4 r/w h'00 h'ffff8207 8 bits
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 214 of 818 rej09b0273-0500 channel name abbrevia- tion r/w initial value address access size 4 timer i/o control register 4a tior4a r/w h'00 h'ffff820a 8 bits 16 bits timer i/o control register 4b tior4b r/w h'00 h'ffff820b 8 bits free-running counter 4 tcnt4 r/w h'0000 h'ffff8218 16 bits general register 4a gr4a r/w h'ffff h'ffff821a 16 bits general register 4b gr4b r/w h'ffff h'ffff821c 16 bits general register 4c gr4c r/w h'ffff h'ffff821e 16 bits general register 4d gr4d r/w h'ffff h'ffff8220 16 bits 5 timer control register 5 tcr5 r/w h'00 h'ffff820c 8 bits 16 bits timer i/o control register 5a tior5a r/w h'00 h'ffff820d 8 bits free-running counter 5 tcnt5 r/w h'0000 h'ffff8222 16 bits general register 5a gr5a r/w h'ffff h'ffff8224 16 bits general register 5b gr5b r/w h'ffff h'ffff8226 16 bits 6 ? 9 timer interrupt enable register e tiere r/w h'00 h'ffff8240 8 bits timer status register e tsre r/(w) * 1 h'00 h'ffff8241 8 bits 6 free-running counter 6 tcnt6 r/w h'0001 h'ffff8246 16 bits cycle register 6 cylr6 r/w h'ffff h'ffff8248 16 bits buffer register 6 bfr6 r/w h'ffff h'ffff824a 16 bits duty register 6 dtr6 r/w h'ffff h'ffff824c 16 bits timer control register 6 tcr6 r/w h'00 h'ffff8243 8 bits 16 bits 7 timer control register 7 tcr7 r/w h'00 h'ffff8242 8 bits free-running counter 7 tcnt7 r/w h'0001 h'ffff824e 16 bits cycle register 7 cylr7 r/w h'ffff h'ffff8250 16 bits buffer register 7 bfr7 r/w h'ffff h'ffff8252 16 bits duty register 7 dtr7 r/w h'ffff h'ffff8254 16 bits 8 free-running counter 8 tcnt8 r/w h'0001 h'ffff8256 16 bits cycle register 8 cylr8 r/w h'ffff h'ffff8258 16 bits buffer register 8 bfr8 r/w h'ffff h'ffff825a 16 bits duty register 8 dtr8 r/w h'ffff h'ffff825c 16 bits timer control register 8 tcr8 r/w h'00 h'ffff8245 8 bits 16 bits 9 timer control register 9 tcr9 r/w h'00 h'ffff8244 8 bits
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 215 of 818 rej09b0273-0500 channel name abbrevia- tion r/w initial value address access size 9 free-running counter 9 tcnt9 r/w h'0001 h'ffff825e 16 bits cycle register 9 cylr9 r/w h'ffff h'ffff8260 16 bits buffer register 9 bfr9 r/w h'ffff h'ffff8262 16 bits duty register 9 dtr9 r/w h'ffff h'ffff8264 16 bits 10 timer control register 10 tcr10 r/w h'00 h'ffff82e0 8 bits 16 bits timer connection register tcnr r/w h'00 h'ffff82e1 8 bits timer interrupt enable register f tierf r/w h'00 h'ffff82e2 8 bits timer status register f tsrf r/(w) * 1 h'00 h'ffff82e3 8 bits down-count start register dstr r/(w) * 2 h'00 h'ffff82e5 8 bits down-counter 10a dcnt10a r/w h'ffff h'ffff82f0 16 bits down-counter 10b dcnt10b r/w h'ffff h'ffff82f2 16 bits down-counter 10c dcnt10c r/w h'ffff h'ffff82f4 16 bits down-counter 10d dcnt10d r/w h'ffff h'ffff82f6 16 bits down-counter 10e dcnt10e r/w h'ffff h'ffff82f8 16 bits down-counter 10f dcnt10f r/w h'ffff h'ffff82fa 16 bits down-counter 10g dcnt10g r/w h'ffff h'ffff82fc 16 bits down-counter 10h dcnt10h r/w h'ffff h'ffff82fe 16 bits notes: 1. only 0 can be written after reading 1, to clear flags. 2. only 1 can be written, to set flags. 8-bit registers, and 16-bit registers and counters, are accessed in two cycles, but since the data bus is 16 bits wide, 32-bit registers and counters are accessed in four cycles.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 216 of 818 rej09b0273-0500 10.2 register descriptions 10.2.1 timer start register (tstr) the timer start register (tstr) is a 16-bit register. the atu has one tstr register. bit:1514131211109876543210 ?????? str9 str8 str7 str6 str5 str4 str3 str2 str1 str0 initial value:0000000000000000 r/w:rrrrrrr/wr/wr/wr/wr/wr/wr/wr/wr/wr/w tstr is a 16-bit readable/writable register that starts and stops the free-running counter (tcnt) in channels 0 to 9. tstr is initialized to h'0000 by a power-on reset, and in hardware standby mode and software standby mode. bits 15 to 10?reserved: these bits are always read as 0, and should only be written with 0. bit 9?counter start 9 (str9): starts and stops free-running counter 9 (tcnt9). bit 9: str7 description 0 tcnt9 is halted (initial value) 1 tcnt9 counts bit 8?counter start 8 (str8): starts and stops free-running counter 8 (tcnt8). bit 8: str8 description 0 tcnt8 is halted (initial value) 1 tcnt8 counts
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 217 of 818 rej09b0273-0500 bit 7?counter start 7 (str7): starts and stops free-running counter 7 (tcnt7). bit 7: str7 description 0 tcnt7 is halted (initial value) 1 tcnt7 counts bit 6?counter start 6 (str6): starts and stops free-running counter 6 (tcnt6). bit 6: str6 description 0 tcnt6 is halted (initial value) 1 tcnt6 counts bit 5?counter start 5 (str5): starts and stops free-running counter 5 (tcnt5). bit 5: str5 description 0 tcnt5 is halted (initial value) 1 tcnt5 counts bit 4?counter start 4 (str4): starts and stops free-running counter 4 (tcnt4). bit 4: str4 description 0 tcnt4 is halted (initial value) 1 tcnt4 counts bit 3?counter start 3 (str3): starts and stops free-running counter 3 (tcnt3). bit 3: str3 description 0 tcnt3 is halted (initial value) 1 tcnt3 counts
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 218 of 818 rej09b0273-0500 bit 2?counter start 2 (str2): starts and stops free-running counter 2 (tcnt2). bit 2: str2 description 0 tcnt2 is halted (initial value) 1 tcnt2 counts bit 1?counter start 1 (str1): starts and stops free-running counter 1 (tcnt1). bit 1: str1 description 0 tcnt1 is halted (initial value) 1 tcnt1 counts bit 0?counter start 0 (str0): starts and stops free-running counter 0 (tcnt0). bit 0: str0 description 0 tcnt0 is halted (initial value) 1 tcnt0 counts 10.2.2 timer mode register (tmdr) the timer mode register (tmdr) is an 8-bit register. the atu has one tdr register. bit:76543210 ????? t5pwn t4pwn t3pwn initial value:00000000 r/w:rrrrrr/wr/wr/w tmdr is an 8-bit readable/writable register that specifies whether channels 3 to 5 are used in input capture/output compare mode or pwm mode. tmdr is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode. bits 7 to 3?reserved: these bits are always read as 0, and should only be written with 0.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 219 of 818 rej09b0273-0500 bit 2?pwm mode 5 (t5pwm): selects whether channel 5 operates in input capture/output compare mode or pwm mode. bit 2: t5pwm description 0 channel 5 operates in input capture/output compare mode (initial value) 1 channel 5 operates in pwm mode when bit t5pwm is set to 1 to select pwm mode, pin tioa5 becomes a pwm output pin, general register 5b (gr5b) functions as a cycle register, and general register 5a (gr5a) as a duty register. bit 1?pwm mode 4 (t4pwm): selects whether channel 4 operates in input capture/output compare mode or pwm mode. bit 1: t4pwm description 0 channel 4 operates in input capture/output compare mode (initial value) 1 channel 4 operates in pwm mode when bit t4pwm is set to 1 to select pwm mode, pins tioa4 to tioc4 become pwm output pins, general register 4d (gr4d) functions as a cycle register, and general registers 4a to 4c (gr4a to gr4c) as duty registers. bit 0?pwm mode 3 (t3pwm): selects whether channel 3 operates in input capture/output compare mode or pwm mode. bit 0: t3pwm description 0 channel 3 operates in input capture/output compare mode (initial value) 1 channel 3 operates in pwm mode when bit t3pwm is set to 1 to select pwm mode, pins tioa3 to tioc3 become pwm output pins, general register 3d (gr3d) functions as a cycle register, and general registers 3a to 3c (gr3a to gr3c) as duty registers.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 220 of 818 rej09b0273-0500 10.2.3 prescaler register 1 (pscr1) prescaler register 1 (pscr1) is an 8-bit register. the atu has one pscr1 register. bit:76543210 ??? psce pscd pscc pscb psca initial value:00000000 r/w: r r r r/w r/w r/w r/w r/w pscr1 is an 8-bit readable/writable register that enables the first-stage counter clock
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 221 of 818 rej09b0273-0500 10.2.4 timer control registers (tcr) the timer control registers (tcr) are 8-bit registers. the atu has ten tcr registers. one for each channel. channel abbreviation function 1 tcr1 2 tcr2 3 tcr3 4 tcr4 5 tcr5 internal clock/external clock selection when internal clock is selected: further scaling of clock ' scaled with pscr1, to create " when external clock is selected: selection of 2 external clocks, selection of input edge 6 tcr6 7 tcr7 8 tcr8 9 tcr9 further scaling of clock ' scaled with pscr1, to create " (internal clock only) 10 tcr10 further scaling of clock ' scaled with pscr1, to create " (internal clock only) each tcr is an 8-bit readable/writable register that selects whether an internal clock or external clock is used for channels 1 to 5. when an internal clock is selected, tcr selects the value of
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 222 of 818 rej09b0273-0500 timer control registers 1 to 5 (tcr1 to tcr5) bit:76543210 ?? ckeg1 ckeg0 ? cksel2 cksel1 cksel0 initial value:00000000 r/w: r r r/w r/w r r/w r/w r/w bits 7 and 6?reserved: these bits are always read as 0, and should only be written with 0. bits 5 and 4?clock edge 1 and 0 (ckeg1, ckeg0): these bits select external clock input edges when an external clock is used. bit 5: ckeg1 bit 4: ckeg0 description 0 0 rising edges counted (initial value) 1 falling edges counted 1 0 both rising and falling edges counted 1 external clock count disabled bit 3?reserved: this bit is always read as 0, and should only be written with 0. bits 2 to 0?clock select 2 to 0 (cksel2 to cksel0): these bits select whether an internal clock or external clock is used. when an internal clock is selected, scaled clock
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 223 of 818 rej09b0273-0500 bit 2: cksel2 bit 1: cksel1 bit 0: cksel0 description 0 0 0 internal clock ": counting on ' (initial value) 1 internal clock ": counting on '/2 1 0 internal clock ": counting on '/4 1 internal clock ": counting on '/8 1 0 0 internal clock ": counting on '/16 1 internal clock ": counting on '/32 1 0 external clock: counting on tclka pin input 1 external clock: counting on tclkb pin input timer control registers 6 to 9 (tcr6 to tcr9) bit:76543210 ????? cksel2 cksel1 cksel0 initial value:00000000 r/w:rrrrrr/wr/wr/w bits 7 to 3?reserved: these bits are always read as 0, and should only be written with 0. bits 2 to 0?clock select 2 to 0 (cksel2 to cksel0): these bits select clock 0 0 0 internal clock ": counting on ' (initial value) 1 internal clock ": counting on '/2 1 0 internal clock ": counting on '/4 1 internal clock ": counting on '/8 1 0 0 internal clock ": counting on '/16 1 internal clock ": counting on '/32 1 0 cannot be set 1 cannot be set
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 224 of 818 rej09b0273-0500 timer control register 10 (tcr10) bit:76543210 ? cksel 2a cksel 1a cksel 0a ? cksel 2b cksel 1b cksel 0b initial value:00000000 r/w: r r/w r/w r/w r r/w r/w r/w bit 7?reserved: this bit is always read as 0, and should only be written with 0. bits 6 to 4?clock select 2a to 0a (cksel2a to cksel0a): these bits select clock 0 0 0 internal clock ": counting on ' (initial value) 1 internal clock ": counting on '/2 1 0 internal clock ": counting on '/4 1 internal clock ": counting on '/8 1 0 0 internal clock ": counting on '/16 1 internal clock ": counting on '/32 1 0 cannot be set 1 cannot be set bit 3?reserved: this bit is always read as 0, and should only be written with 0.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 225 of 818 rej09b0273-0500 bits 2 to 0?clock select 2b to 0b (cksel2b to cksel0b): these bits select clock 0 0 0 internal clock ": counting on ' (initial value) 1 internal clock ": counting on '/2 1 0 internal clock ": counting on '/4 1 internal clock ": counting on '/8 1 0 0 internal clock ": counting on '/16 1 internal clock ": counting on '/32 1 0 cannot be set 1 cannot be set 10.2.5 timer i/o control registers (tior) the timer i/o control registers (tior) are 8-bit registers. the atu has ten tior registers, one for channel 0, three for channel 1, one for channel 2, two each for channels 3 and 4, and one for channel 5. channel abbreviation function 0 tior0a icr0 and osbr edge detection setting 1tior1a, tior1b, tior1c 2tior2a gr1 and gr2 input capture/compare-match switching, edge detection/output value setting 3tior3a, tior3b 4tior4a, tior4b 5tior5a gr3 to gr5 input capture/compare-match switching, edge detection/output value setting, tcnt3 to tcnt5 clear enable/disable setting each tior is an 8-bit readable/writable register used to select the functions of dedicated input capture registers and general registers. for dedicated input capture registers (icr), tior performs edge detection setting.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 226 of 818 rej09b0273-0500 for general registers (gr), tior selects use as an input capture register or output compare register, and performs edge detection setting. for channels 3 to 5, tior also selects enabling or disabling of free-running counter (tcnt) clearing. each tior is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode. timer i/o control register 0a (tior0a) timer i/o control register 0a (tior0a) is an 8-bit register. channel 1 has one tior register. bit:76543210 io0d1 io0d0 io0c1 io0c0 io0b1 io0b0 io0a1 io0a0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w tior0a specifies edge detection for input capture registers icr0a to icr0d. bits 7 and 6?i/o control 0d1 and 0d0 (io0d1, io0d0): these bits select input capture register 0d (icr0d) edge detection. bit 7: io0d1 bit 6: io0d0 description 0 0 input capture disabled (initial value) 1 input capture in icr0d on rising edge 1 0 input capture in icr0d on falling edge 1 input capture in icr0d on both rising and falling edges bits 5 and 4?i/o control 0c1 and 0c0 (io0c1, io0c0): these bits select input capture register 0c (icr0c) edge detection. bit 5: io0c1 bit 4: io0c0 description 0 0 input capture disabled (initial value) 1 input capture in icr0c on rising edge 1 0 input capture in icr0c on falling edge 1 input capture in icr0c on both rising and falling edges
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 227 of 818 rej09b0273-0500 bits 3 and 2?i/o control 0b1 and 0b0 (io0b1, io0b0): these bits select input capture register 0b (icr0b) edge detection. bit 3: io0b1 bit 2: io0b0 description 0 0 input capture disabled (initial value) 1 input capture in icr0b on rising edge 1 0 input capture in icr0b on falling edge 1 input capture in icr0b on both rising and falling edges bits 1 and 0?i/o control 0a1 and 0a0 (io0a1, io0a0): these bits select input capture register 0a (icr0a) and offset base register (osbr) edge detection. bit 1: io0a1 bit 0: io0a0 description 0 0 input capture disabled (initial value) 1 input capture in icr0a on rising edge 1 0 input capture in icr0a on falling edge 1 input capture in icr0a on both rising and falling edges
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 228 of 818 rej09b0273-0500 timer i/o control registers 1a to 1c and 2a (tior1a to tior1c, tior2a) timer i/o control register 1a to 1c and 2a (tior1a to tior1c, tior2a) are 8-bit registers. there are four tior registers, three for timer 1 and one for timer 2. tior1a bit:76543210 ? io1b2 io1b1 io1b0 ? io1a2 io1a1 io1a0 initial value:00000000 r/w: r r/w r/w r/w r r/w r/w r/w tior1b bit:76543210 ? io1d2 io1d1 io1d0 ? io1c2 io1c1 io1c0 initial value:00000000 r/w: r r/w r/w r/w r r/w r/w r/w tior1c bit:76543210 ? io1f2 io1f1 io1f0 ? io1e2 io1e1 io1e0 initial value:00000000 r/w: r r/w r/w r/w r r/w r/w r/w registers tior0a to tior1c specify whether general registers gr1a to gr1f are used as input capture or compare-match registers, and also perform edge detection and output value setting. each tior is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode. tior2a bit:76543210 ? io2b2 io2b1 io2b0 ? io2a2 io2a1 io2a0 initial value:00000000 r/w: r r/w r/w r/w r r/w r/w r/w tior2a specifies whether general registers gr2a and gr2b are used as input capture or compare-match registers, and also performs edge detection and output value setting.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 229 of 818 rej09b0273-0500 tior2a is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode. bit 7?reserved: this bit is always read as 0, and should only be written with 0. bits 6 to 4?i/o control 1b2 to 1b0, 1d2 to 1d0, 1f2 to 1f0, 2b2 to 2b0 (io1b2 to io1b0, io1d2 to io1d0, iof12 to io1f0, io2b2 to io2b0): these bits select the general register (gr) function. bit 6: ioxx2 bit 5: ioxx1 bit 4: ioxx0 description 0 0 0 0 output regardless of compare-match (initial value) 1 0 output on gr compare-match 1 0 1 output on gr compare-match 1 gr is an output compare register toggle output on gr compare-match 1 0 0 input capture disabled 1 input capture in gr on rising edge 1 0 input capture in gr on falling edge 1 gr is input capture register input capture in gr on both rising and falling edges bit 3?reserved: this bit is always read as 0, and should only be written with 0. bits 2 to 0?i/o control 1a2 to 1a0, 1c2 to 1c0, 1e2 to 1e0, 2a2 to 2a0 (io1a2 to io1a0, io1c2 to io1c0, io1e2 to io1e0, io2a2 to io2a0): these bits select the general register (gr) function.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 230 of 818 rej09b0273-0500 bit 2: ioxx2 bit 1: ioxx1 bit 0: ioxx0 description 0 0 0 0 output regardless of compare-match (initial value) 1 0 output on gr compare-match 1 0 1 output on gr compare-match 1 gr is an output compare register toggle output on gr compare-match 1 0 0 input capture disabled 1 input capture in gr on rising edge 1 0 input capture in gr on falling edge 1 gr is input capture register input capture in gr on both rising and falling edges timer i/o control registers 3a, 3b, 4a, 4b, 5a (tior3a, to0r3b, tior4a, tior4b, tior5a) timer i/o control registers 3a, 3b, 4a, 4b, and 5a (tior3a, to0r3b, tior4a, tior4b, tior5a) are 8-bit registers. there are five tior registers, two each for channels 3 and 4, and one for channel 5. tior3a bit:76543210 cci3b io3b2 io3b1 io3b0 cci3a io3a2 io3a1 io3a0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w tior3b bit:76543210 cci3d io3d2 io3d1 io3d0 cci3c io3c2 io3c1 io3c0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w tior3a and tior3b are 8-bit readable/writable registers. when bit 0 of tmdr is 0, they specify whether general registers gr3a to gr3d are used as input capture or compare-match registers, and also perform edge detection and output value setting. also, when bit 0 of tmdr is 0, they select enabling or disabling of free-running counter (tcnt3) clearing.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 231 of 818 rej09b0273-0500 each tior is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode. tior4a bit:76543210 cci4b io4b2 io4b1 io4b0 cci4a io4a2 io4a1 io4a0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w tior4b bit:76543210 cci4d io4d2 io4d1 io4d0 cci4c io4c2 io4c1 io4c0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w tior4a and tior4b are 8-bit readable/writable registers. when bit 1 of tmdr is 0, they specify whether general registers gr4a to gr4d are used as input capture or compare-match registers, and also perform edge detection and output value setting. also, when bit 1 of tmdr is 0, they select enabling or disabling of free-running counter (tcnt4) clearing. each tior is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode. tior5a bit:76543210 cci5b io5b2 io5b1 io5b0 cci5a io5a2 io5a1 io5a0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w tior5a is an 8-bit readable/writable register. when bit 2 of tmdr is 0, it specifies whether general registers gr5a and gr5b are used as input capture or compare-match registers, and also performs edge detection and output value setting. also, when bit 2 of tmdr is 0, tior5a selects enabling or disabling of free-running counter (tcnt5) clearing. tior5a is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 232 of 818 rej09b0273-0500 bit 7?clear counter enable flag 3b, 3d, 4b, 4d, 5b (cci3b, cci3d, cci4b, cci4d, cci5b): these bits select enabling or disabling of free-running counter (tcnt) clearing. bit 7: ccixx description 0 tcnt clearing disabled (initial value) 1 tcnt cleared on gr compare-match tcnt is cleared on compare-match only when gr is functioning as an output compare register. bits 6 to 4?i/o control 3b2 to 3b0, 3d2 to 3d0, 4b2 to 4b0, 4d2 to 4d0, 5b2 to 5b0 (io3b2 to io3b0, io3d2 to io3d0, io4b2 to io4b0, io4d2 to io4d0, io5b2 to io5b0): these bits select the general register (gr) function. bit 6: ioxx2 bit 5: ioxx1 bit 4: ioxx0 description 0 0 0 0 output regardless of compare-match (initial value) 1 0 output on gr compare-match 1 0 1 output on gr compare-match 1 gr is an output compare register toggle output on gr compare-match 1 0 0 input capture disabled 1 input capture in gr on rising edge 1 0 input capture in gr on falling edge 1 gr is input capture register input capture in gr on both rising and falling edges bit 3?clear counter enable flag 3a, 3c, 4a, 4c, 5a (cci3a, cci3c, cci4a, cci4c, cci5a): these bits select enabling or disabling of free-running counter (tcnt) clearing. bit 3: ccixx description 0 tcnt clearing disabled (initial value) 1 tcnt cleared on gr compare-match tcnt is cleared on compare-match only when gr is functioning as an output compare register.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 233 of 818 rej09b0273-0500 bits 2 to 0?i/o control 3a2 to 3a0, 3c2 to 3c0, 4a2 to 4a0, 4c2 to 4c0, 5a2 to 5a0 (io3a2 to io3a0, io3c2 to io3c0, io4a2 to io4a0, io4c2 to io4c0, io5a2 to io5a0): these bits select the general register (gr) function. bit 2: ioxx2 bit 1: ioxx1 bit 0: ioxx0 description 0 0 0 0 output regardless of compare-match (initial value) 1 0 output on gr compare-match 1 0 1 output on gr compare-match 1 gr is an output compare register toggle output on gr compare-match 1 0 0 input capture disabled 1 input capture in gr on rising edge 1 0 input capture in gr on falling edge 1 gr is input capture register input capture in gr on both rising and falling edges 10.2.6 trigger selection register (tgsr) the trigger selection register (tgsr) is an 8-bit register. the atu has one tgsr register. bit:76543210 ????? trg0d ? trg0a initial value:00000000 r/w:rrrrrr/wrr/w tgsr is an 8-bit readable/writable register that selects an input pin (tioa, tiod) or the compare-match output signal (tgr1a) from the channel 1 general register (gr1a) as the channel 0 input capture register (icr0a, icr0d) input trigger. tgsr is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode. bits 7 to 3?reserved: these bits are always read as 0, and should only be written with 0.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 234 of 818 rej09b0273-0500 bit 2?icr0d input trigger (trg0d): selects whether a pin (tiod) or the channel 1 compare-match signal (trg1a) is to be used as the channel 0 input capture register (icr0d) input trigger. bit 2: trg0d description 0 input pin (tiod) used as input trigger (initial value) 1 channel 1 compare-match signal (trg1a) used as input trigger bit 1?reserved: this bit is always read as 0, and should only be written with 0. bit 0?icr0a input trigger (trg0a): selects whether a pin (tioa) or the channel 1 compare-match signal (trg1a) is to be used as the channel 0 input capture register (icr0a) input trigger. bit 0: trg0a description 0 input pin (tioa) used as input trigger (initial value) 1 channel 1 compare-match signal (trg1a) used as input trigger
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 235 of 818 rej09b0273-0500 10.2.7 timer status registers (tsr) the timer status registers (tsr) are 8-bit registers. the atu has eight tsr registers: two for channel 0, one each for channels 1 and 2, two for channels 3 to 5, one for channels 6 to 9, and one for channel 10. channel abbreviation function 0 tsrah, tsral indicates input capture, interval interrupt, and overflow status. 1 tsrb indicates input capture, compare-match, and overflow status 2tsrc 3 tsrdh, tsrdl indicates input capture, compare-match, and overflow status. 4 5 6 tsre indicates cycle register compare-match status 7 8 9 10 tsrf indicates down-counter underflow status. the tsr registers are 8-bit readable/writable registers containing flags that indicate free-running counter (tcnt) overflow, channel 0 input capture or interval interrupt generation, general register input capture or compare-match, channel 6 to 9 compare-matches, down-counter underflow. each flag is an interrupt source, and issues an interrupt request to the cpu if the interrupt is enabled by the corresponding bit in the timer interrupt enable register (tier). each tsr is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 236 of 818 rej09b0273-0500 timer status registers ah and al (tsrah, tsral) tsrah indicates the status of channel 0 interval interrupts. bit:76543210 ???? iif3 iif2 iif1 iif0 initial value:00000000 r/w:rrrrr/(w) * r/(w) * r/(w) * r/(w) * note: * only 0 can be written, to clear the flag. bits 7 to 4?reserved: these bits are always read as 0, and should only be written with 0. bit 3?interval interrupt flag (iif3): status flag that indicates the generation of an interval interrupt. bit 3: iif3 description 0 [clearing condition] when iif3 is read while set to 1, then 0 is written in iif3 (initial value) 1 [setting condition] when 1 is generated by and of itve3 in itvrr and bit 13 of tcnt0l bit 2?interval interrupt flag (iif2): status flag that indicates the generation of an interval interrupt. bit 2: iif2 description 0 [clearing condition] when iif2 is read while set to 1, then 0 is written in iif2 (initial value) 1 [setting condition] when 1 is generated by and of itve2 in itvrr and bit 12 of tcnt0l
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 237 of 818 rej09b0273-0500 bit 1?interval interrupt flag (iif1): status flag that indicates the generation of an interval interrupt. bit 1: iif1 description 0 [clearing condition] when iif1 is read while set to 1, then 0 is written in iif1 (initial value) 1 [setting condition] when 1 is generated by and of itve1 in itvrr and bit 11 of tcnt0l bit 0?interval interrupt flag (iif0): status flag that indicates the generation of an interval interrupt. bit 0: iif0 description 0 [clearing condition] when iif0 is read while set to 1, then 0 is written in iif0 (initial value) 1 [setting condition] when 1 is generated by and of itve0 in itvrr and bit 10 of tcnt0l tsral indicates the status of channel 0 input capture and overflow. bit:76543210 ??? ovf0 icf0d icf0c icf0b icf0a initial value:00000000 r/w: r r r r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * only 0 can be written, to clear the flag. bits 7 to 5?reserved: these bits are always read as 0, and should only be written with 0. bit 4?overflow flag (ovf0): status flag that indicates tcnt0 overflow.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 238 of 818 rej09b0273-0500 bit 4: ovf0 description 0 [clearing condition] when ovf0 is read while set to 1, then 0 is written in ovf0 (initial value) 1 [setting condition] when the tcnt0 value overflows (from h'ffffffff to h'00000000) bit 3?input capture flag (icf0d): status flag that indicates icr0d input capture. bit 3: icf0d description 0 [clearing condition] when icf0d is read while set to 1, then 0 is written in icf0d (initial value) 1 [setting condition] when the tcnt0 value is transferred to the input capture register (icr0d) by an input capture signal bit 2?input capture flag (icf0c): status flag that indicates icr0c input capture. bit 2: icf0c description 0 [clearing condition] when icf0c is read while set to 1, then 0 is written in icf0c (initial value) 1 [setting condition] when the tcnt0 value is transferred to the input capture register (icr0c) by an input capture signal bit 1?input capture flag (icf0b): status flag that indicates icr0b input capture. bit 1: icf0b description 0 [clearing condition] when icf0b is read while set to 1, then 0 is written in icf0b (initial value) 1 [setting condition] when the tcnt0 value is transferred to the input capture register (icr0b) by an input capture signal
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 239 of 818 rej09b0273-0500 bit 0?input capture flag (icf0a): status flag that indicates icr0a input capture. bit 0: icf0a description 0 [clearing condition] when icf0a is read while set to 1, then 0 is written in icf0a (initial value) 1 [setting condition] when the tcnt0 value is transferred to the input capture register (icr0a) by an input capture signal timer status register b (tsrb) tsrb indicates the status of channel 1 input capture, compare-match, and overflow. bit:76543210 ? ovf1 imf1f imf1e imf1d imf1c imf1b imf1a initial value:00000000 r/w: r r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * only 0 can be written, to clear the flag. bit 7?reserved: this bit is always read as 0, and should only be written with 0. bit 6?overflow flag (ovf1): status flag that indicates tcnt1 overflow. bit 6: ovf1 description 0 [clearing condition]) when ovf1 is read while set to 1, then 0 is written in ovf1 (initial value) 1 [setting condition] when the tcnt1 value overflows (from h'ffff to h'0000)
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 240 of 818 rej09b0273-0500 bit 5?input capture/compare-match flag (imf1f): status flag that indicates gr1f input capture or compare-match. bit 5: imf1f description 0 [clearing condition] when imf1f is read while set to 1, then 0 is written in imf1f (initial value) 1 [setting conditions] ? when the tcnt1 value is transferred to gr1f by an input capture signal while gr1f is functioning as an input capture register ? when tcnt1 = gr1f while gr1f is functioning as an output compare register bit 4?input capture/compare-match flag (imf1e): status flag that indicates gr1e input capture or compare-match. bit 4: imf1e description 0 [clearing condition] when imf1e is read while set to 1, then 0 is written in imf1e (initial value) 1 [setting conditions] ? when the tcnt1 value is transferred to gr1e by an input capture signal while gr1e is functioning as an input capture register ? when tcnt1 = gr1e while gr1e is functioning as an output compare register bit 3?input capture/compare-match flag (imf1d): status flag that indicates gr1d input capture or compare-match. bit 3: imf1d description 0 [clearing condition] when imf1d is read while set to 1, then 0 is written in imf1d (initial value) 1 [setting conditions] ? when the tcnt1 value is transferred to gr1d by an input capture signal while gr1d is functioning as an input capture register ? when tcnt1 = gr1d while gr1d is functioning as an output compare register
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 241 of 818 rej09b0273-0500 bit 2?input capture/compare-match flag (imf1c): status flag that indicates gr1c input capture or compare-match. bit 2: imf1c description 0 [clearing condition] when imf1c is read while set to 1, then 0 is written in imf1c (initial value) 1 [setting conditions] ? when the tcnt1 value is transferred to gr1c by an input capture signal while gr1c is functioning as an input capture register ? when tcnt1 = gr1c while gr1c is functioning as an output compare register bit 1?input capture/compare-match flag (imf1b): status flag that indicates gr1b input capture or compare-match. bit 1: imf1b description 0 [clearing condition] when imf1b is read while set to 1, then 0 is written in imf1b (initial value) 1 [setting conditions] ? when the tcnt1 value is transferred to gr1b by an input capture signal while gr1b is functioning as an input capture register ? when tcnt1 = gr1b while gr1b is functioning as an output compare register bit 0?input capture/compare-match flag (imf1a): status flag that indicates gr1a input capture or compare-match. bit 0: imf1a description 0 [clearing condition] when imf1a is read while set to 1, then 0 is written in imf1a (initial value) 1 [setting conditions] ? when the tcnt1 value is transferred to gr1a by an input capture signal while gr1a is functioning as an input capture register ? when tcnt1 = gr1a while gr1a is functioning as an output compare register
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 242 of 818 rej09b0273-0500 timer status register c (tsrc) tsrc indicates the status of channel 2 input capture, compare-match, and overflow. bit:76543210 ????? ovf2 imf2b imf2a initial value:00000000 r/w:rrrrrr/(w) * r/(w) * r/(w) * note: * only 0 can be written, to clear the flag. bits 7 to 3?reserved: these bits are always read as 0, and should only be written with 0. bit 2?overflow flag (ovf2): status flag that indicates tcnt2 overflow. bit 2: ovf2 description 0 [clearing condition] when ovf2 is read while set to 1, then 0 is written in ovf2 (initial value) 1 [setting condition] when the tcnt2 value overflows (from h'ffff to h'0000) bit 1?input capture/compare-match flag (imf2b): status flag that indicates gr2b input capture or compare-match. bit 1: imf2b description 0 [clearing condition] when imf2b is read while set to 1, then 0 is written in imf2b (initial value) 1 [setting conditions] ? when the tcnt2 value is transferred to gr2b by an input capture signal while gr2b is functioning as an input capture register ? when tcnt2 = gr2b while gr2b is functioning as an output compare register
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 243 of 818 rej09b0273-0500 bit 0?input capture/compare-match flag (imf2a): status flag that indicates gr2a input capture or compare-match. bit 0: imf2a description 0 [clearing condition] when imf2a is read while set to 1, then 0 is written in imf2a (initial value) 1 [setting conditions] ? when the tcnt2 value is transferred to gr2a by an input capture signal while gr2a is functioning as an input capture register ? when tcnt2 = gr2a while gr2a is functioning as an output compare register timer status registers dh and dl (tsrdh, tsrdl) tsrdh indicates the status of channel 3 input capture, compare-match, and overflow. bit:76543210 ??? ovf3 imf3d imf3c imf3b imf3a initial value:00000000 r/w: r r r r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * only 0 can be written, to clear the flag. bits 7 to 5?reserved: these bits are always read as 0, and should only be written with 0. bit 4?overflow flag (ovf3): status flag that indicates tcnt3 overflow. bit 4: ovf3 description 0 [clearing condition] when ovf3 is read while set to 1, then 0 is written in ovf3 (initial value) 1 [setting condition] when the tcnt3 value overflows (from h'ffff to h'0000)
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 244 of 818 rej09b0273-0500 bit 3?input capture/compare-match flag (imf3d): status flag that indicates gr3d input capture or compare-match. bit 3: imf3d description 0 [clearing condition] when imf3d is read while set to 1, then 0 is written in imf3d (initial value) 1 [setting conditions] ? when the tcnt3 value is transferred to gr3d by an input capture signal while gr3d is functioning as an input capture register ? when tcnt3 = gr3d while gr3d is functioning as an output compare register bit 2?input capture/compare-match flag (imf3c): status flag that indicates gr3c input capture or compare-match. bit 2: imf3c description 0 [clearing condition] when imf3c is read while set to 1, then 0 is written in imf3c (initial value) 1 [setting conditions] ? when the tcnt3 value is transferred to gr3c by an input capture signal while gr3c is functioning as an input capture register ? when tcnt3 = gr3c while gr3c is functioning as an output compare register bit 1?input capture/compare-match flag (imf3b): status flag that indicates gr3b input capture or compare-match. bit 1: imf3b description 0 [clearing condition]) when imf3b is read while set to 1, then 0 is written in imf3b (initial value) 1 [setting conditions] ? when the tcnt3 value is transferred to gr3b by an input capture signal while gr3b is functioning as an input capture register ? when tcnt3 = gr3b while gr3b is functioning as an output compare register
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 245 of 818 rej09b0273-0500 bit 0?input capture/compare-match flag (imf3a): status flag that indicates gr3a input capture or compare-match. bit 0: imf3a description 0 [clearing condition] when imf3a is read while set to 1, then 0 is written in imf3a (initial value) 1 [setting conditions] ? when the tcnt3 value is transferred to gr3a by an input capture signal while gr3a is functioning as an input capture register ? when tcnt3 = gr3a while gr3a is functioning as an output compare register tsrdl indicates the status of channel 4 and 5 input capture, compare-match, and overflow. bit:76543210 ovf4 imf4d imf4c imf4b imf4a ovf5 imf5b imf5a initial value:00000000 r/w: r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * only 0 can be written, to clear the flag. bit 7?overflow flag (ovf4): status flag that indicates tcnt4 overflow. bit 7: ovf4 description 0 [clearing condition] when ovf4 is read while set to 1, then 0 is written in ovf4 (initial value) 1 [setting condition] when the tcnt4 value overflows (from h'ffff to h'0000)
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 246 of 818 rej09b0273-0500 bit 6?input capture/compare-match flag (imf4d): status flag that indicates gr4d input capture or compare-match. bit 6: imf4d description 0 [clearing condition]) when imf4d is read while set to 1, then 0 is written in imf4d (initial value) 1 [setting conditions] ? when the tcnt4 value is transferred to gr4d by an input capture signal while gr4d is functioning as an input capture register ? when tcnt4 = gr4d while gr4d is functioning as an output compare register bit 5?input capture/compare-match flag (imf4c): status flag that indicates gr4c input capture or compare-match. bit 5: imf4c description 0 [clearing condition] when imf4c is read while set to 1, then 0 is written in imf4c (initial value) 1 [setting conditions] ? when the tcnt4 value is transferred to gr4c by an input capture signal while gr4c is functioning as an input capture register ? when tcnt4 = gr4c while gr4c is functioning as an output compare register bit 4?input capture/compare-match flag (imf4b): status flag that indicates gr4b input capture or compare-match. bit 4: imf4b description 0 [clearing condition] when imf4b is read while set to 1, then 0 is written in imf4b (initial value) 1 [setting conditions] ? when the tcnt4 value is transferred to gr4b by an input capture signal while gr4b is functioning as an input capture register ? when tcnt4 = gr4b while gr4b is functioning as an output compare register
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 247 of 818 rej09b0273-0500 bit 3?input capture/compare-match flag (imf4a): status flag that indicates gr4a input capture or compare-match. bit 3: imf4a description 0 [clearing condition] when imf4a is read while set to 1, then 0 is written in imf4a (initial value) 1 [setting conditions] ? when the tcnt4 value is transferred to gr4a by an input capture signal while gr4a is functioning as an input capture register ? when tcnt4 = gr4a while gr4a is functioning as an output compare register bit 2?overflow flag (ovf5): status flag that indicates tcnt5 overflow. bit 2: ovf5 description 0 [clearing condition] when ovf5 is read while set to 1, then 0 is written in ovf5 (initial value) 1 [setting condition] when the tcnt5 value overflows (from h'ffff to h'0000) bit 1?input capture/compare-match flag (imf5b): status flag that indicates gr5b input capture or compare-match. bit 1: imf5b description 0 [clearing condition] when imf5b is read while set to 1, then 0 is written in imf5b (initial value) 1 [setting conditions] ? when the tcnt5 value is transferred to gr5b by an input capture signal while gr5b is functioning as an input capture register ? when tcnt5 = gr5b while gr5b is functioning as an output compare register
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 248 of 818 rej09b0273-0500 bit 0?input capture/compare-match flag (imf5a): status flag that indicates gr5a input capture or compare-match. bit 0: imf5a description 0 [clearing condition] when imf5a is read while set to 1, then 0 is written in imf5a (initial value) 1 [setting conditions] ? when the tcnt5 value is transferred to gr5a by an input capture signal while gr5a is functioning as an input capture register ? when tcnt5 = gr5a while gr5a is functioning as an output compare register timer status register e (tsre) tsre indicates the status of channel 6 to 9 cycle register compare-matches. bit:76543210 ? cmf6 ? cmf7 ? cmf8 ? cmf9 initial value:00000000 r/w: r r/(w) * rr/(w) * rr/(w) * rr/(w) * note: * only 0 can be written, to clear the flag. bit 7?reserved: this bit is always read as 0, and should only be written with 0. bit 6?cycle register compare-match flag (cmf6): status flag that indicates cylr6 compare-match. bit 6: cmf6 description 0 [clearing conditions] ? when cmf6 is read while set to 1, then 0 is written in cmf6 ? when cleared by the dmac after data transfer when used as a dmac activation source (initial value) 1 [setting condition] when tcnt6 = cylr6
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 249 of 818 rej09b0273-0500 bit 5?reserved: this bit is always read as 0, and should only be written with 0. bit 4?cycle register compare-match flag (cmf7): status flag that indicates cylr7 compare-match. bit 4: cmf7 description 0 [clearing condition]) when cmf7 is read while set to 1, then 0 is written in cmf7 (initial value) 1 [setting condition] when tcnt7 = cylr7 bit 3?reserved: this bit is always read as 0, and should only be written with 0. bit 2?cycle register compare-match flag (cmf8): status flag that indicates cylr8 compare-match. bit 2: cmf8 description 0 [clearing condition] when cmf8 is read while set to 1, then 0 is written in cmf8 (initial value) 1 [setting condition] when tcnt8 = cylr8 bit 1?reserved: this bit is always read as 0, and should only be written with 0. bit 0?cycle register compare-match flag (cmf9): status flag that indicates cylr9 compare-match. bit 0: cmf9 description 0 [clearing condition] when cmf9 is read while set to 1, then 0 is written in cmf9 (initial value) 1 [setting condition] when tcnt9 = cylr9
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 250 of 818 rej09b0273-0500 timer status register f (tsrf) tsrf indicates the channel 10 one-shot pulse status. bit:76543210 osf10h osf10g osf10f osf10e osf10d osf10c osf10b osf10a initial value:00000000 r/w: r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * only 0 can be written, to clear the flag. bit 7?one-shot pulse flag (osf10h): status flag that indicates a dcnt10h one-shot pulse. bit 7: osf10h description 0 [clearing condition]) when osf10h is read while set to 1, then 0 is written in osf10h (initial value) 1 [setting condition] when the down-counter (dcnt10h) value underflows bit 6?one-shot pulse flag (osf10g): status flag that indicates a dcnt10g one-shot pulse. bit 6: osf10g description 0 [clearing condition] when osf10g is read while set to 1, then 0 is written in osf10g (initial value) 1 [setting condition] when the down-counter (dcnt10g) value underflows bit 5?one-shot pulse flag (osf10f): status flag that indicates a dcnt10f one-shot pulse. bit 5: osf10f description 0 [clearing condition] when osf10f is read while set to 1, then 0 is written in osf10f (initial value) 1 [setting condition] when the down-counter (dcnt10f) value underflows
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 251 of 818 rej09b0273-0500 bit 4?one-shot pulse flag (osf10e): status flag that indicates a dcnt10e one-shot pulse. bit 4: osf10e description 0 [clearing condition] when osf10e is read while set to 1, then 0 is written in osf10e (initial value) 1 [setting condition] when the down-counter (dcnt10e) value underflows bit 3?one-shot pulse flag (osf10d): status flag that indicates a dcnt10d one-shot pulse. bit 3: osf10d description 0 [clearing condition]) when osf10d is read while set to 1, then 0 is written in osf10d (initial value) 1 [setting condition] when the down-counter (dcnt10d) value underflows bit 2?one-shot pulse flag (osf10c): status flag that indicates a dcnt10c one-shot pulse. bit 2: osf10c description 0 [clearing condition] when osf10c is read while set to 1, then 0 is written in osf10c (initial value) 1 [setting condition] when the down-counter (dcnt10c) value underflows bit 1?one-shot pulse flag (osf10b): status flag that indicates a dcnt10b one-shot pulse. bit 1: osf10b description 0 [clearing condition] when osf10b is read while set to 1, then 0 is written in osf10b (initial value) 1 [setting condition] when the down-counter (dcnt10b) value underflows
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 252 of 818 rej09b0273-0500 bit 0?one-shot pulse flag (osf10a): status flag that indicates a dcnt10a one-shot pulse. bit 0: osf10a description 0 [clearing condition] when osf10a is read while set to 1, then 0 is written in osf10a (initial value) 1 [setting condition] when the down-counter (dcnt10a) value underflows 10.2.8 timer interrupt enable registers (tier) the timer interrupt enable registers (tier) are 8-bit registers. the atu has seven tier registers: one each for channels 0, 1, and 2, two for channels 3 to 5, one for channels 6 to 9, and one for channel 10. channel abbreviation function 0 tiera controls input capture, compare-match, and interval interrupt request enabling/disabling. 1tierb 2tierc controls input capture, compare-match, and overflow interrupt request enabling/disabling. 3 4 5 tierdh, tierdl controls input capture, compare-match, and overflow interrupt request enabling/disabling. 6tiere 7 8 9 controls cycle register compare-match interrupt request enabling/disabling. 10 tierf controls underflow interrupt request enabling/disabling. the tier registers are 8-bit readable/writable registers that control enabling/disabling of free- running counter (tcnt) overflow interrupt requests, channel 0 input capture interrupt requests, interval interrupt requests, general register and dedicated input capture register input capture/compare-match interrupt requests, channel 6 to 9 compare-match interrupt requests, and down-counter (dcnt) underflow interrupt requests. each tier is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 253 of 818 rej09b0273-0500 timer interrupt enable register a (tiera) tiera controls enabling/disabling of channel 0 input capture and overflow interrupt requests. bit:76543210 ??? ove0 ice0d ice0c ice0b ice0a initial value:00000000 r/w: r r r r/w r/w r/w r/w r/w bits 7 to 5?reserved: these bits are always read as 0, and should only be written with 0. bit 4?overflow interrupt enable (ove0): enables or disables ovi0 requests when the overflow flag (ovf0) in tsr is set to 1. bit 4: ove0 description 0 ovi0 interrupt requested by ovf0 is disabled (initial value) 1 ovi0 interrupt requested by ovf0 is enabled bit 3?input capture interrupt enable (ice0d): enables or disables ici0d requests when the input capture flag (icf0d) in tsr is set to 1. bit 3: ice0d description 0 ici0d interrupt requested by icf0d is disabled (initial value) 1 ici0d interrupt requested by icf0d is enabled bit 2?input capture interrupt enable (ice0c): enables or disables ici0c requests when the input capture flag (icf0c) in tsr is set to 1. bit 2: ice0c description 0 ici0c interrupt requested by icf0c is disabled (initial value) 1 ici0c interrupt requested by icf0c is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 254 of 818 rej09b0273-0500 bit 1?input capture interrupt enable (ice0b): enables or disables ici0b requests when the input capture flag (icf0b) in tsr is set to 1. bit 1: ice0b description 0 ici0b interrupt requested by icf0b is disabled (initial value) 1 ici0b interrupt requested by icf0b is enabled bit 0?input capture interrupt enable (ice0a): enables or disables ici0a requests when the input capture flag (icf0a) in tsr is set to 1. bit 0: ice0a description 0 ici0a interrupt requested by icf0a is disabled (initial value) 1 ici0a interrupt requested by icf0a is enabled timer interrupt enable register b (tierb) tierb controls enabling/disabling of channel 1 input capture, compare-match, and overflow interrupt requests. bit:76543210 ? ove1 ime1f ime1e ime1d ime1c ime1b ime1a initial value:00000000 r/w: r r/w r/w r/w r/w r/w r/w r/w bit 7?reserved: this bit is always read as 0, and should only be written with 0. bit 6?overflow interrupt enable (ove1): enables or disables interrupt requests by ovf1 in tsr when ovf1 is set to 1. bit 6: ove1 description 0 ovi1 interrupt requested by ovf1 is disabled (initial value) 1 ovi1 interrupt requested by ovf1 is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 255 of 818 rej09b0273-0500 bit 5?input capture/compare-match interrupt enable (ime1f): enables or disables interrupt requests by imf1f in tsr when imf1f is set to 1. bit 5: ime1f description 0 imi1f interrupt requested by imf1f is disabled (initial value) 1 imi1f interrupt requested by imf1f is enabled bit 4?input capture/compare-match interrupt enable (ime1e): enables or disables interrupt requests by imf1e in tsr when imf1e is set to 1. bit 4: ime1e description 0 imi1e interrupt requested by imf1e is disabled (initial value) 1 imi1e interrupt requested by imf1e is enabled bit 3?input capture/compare-match interrupt enable (ime1d): enables or disables interrupt requests by imf1d in tsr when imf1d is set to 1. bit 3: ime1d description 0 imi1d interrupt requested by imf1d is disabled (initial value) 1 imi1d interrupt requested by imf1d is enabled bit 2?input capture/compare-match interrupt enable (ime1c): enables or disables interrupt requests by imf1c in tsr when imf1c is set to 1. bit 2: ime1c description 0 imi1c interrupt requested by imf1c is disabled (initial value) 1 imi1c interrupt requested by imf1c is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 256 of 818 rej09b0273-0500 bit 1?input capture/compare-match interrupt enable (ime1b): enables or disables interrupt requests by imf1b in tsr when imf1b is set to 1. bit 1: ime1b description 0 imi1b interrupt requested by imf1b is disabled (initial value) 1 imi1b interrupt requested by imf1b is enabled bit 0?input capture/compare-match interrupt enable (ime1a): enables or disables interrupt requests by imf1a in tsr when imf1a is set to 1. bit 0: ime1a description 0 imi1a interrupt requested by imf1a is disabled (initial value) 1 imi1a interrupt requested by imf1a is enabled timer interrupt enable register c (tierc) tierc controls enabling/disabling of channel 2 input capture, compare-match, and overflow interrupt requests. bit:76543210 ????? ove2 ime2b ime2a initial value:00000000 r/w:rrrrrr/wr/wr/w bits 7 to 3?reserved: these bits are always read as 0, and should only be written with 0. bit 2?overflow interrupt enable (ove2): enables or disables interrupt requests by ovf2 in tsr when ovf2 is set to 1. bit 2: ove2 description 0 ovi2 interrupt requested by ovf2 is disabled (initial value) 1 ovi2 interrupt requested by ovf2 is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 257 of 818 rej09b0273-0500 bit 1?input capture/compare-match interrupt enable (ime2b): enables or disables interrupt requests by imf2b in tsr when imf2b is set to 1. bit 1: ime2b description 0 imi2b interrupt requested by imf2b is disabled (initial value) 1 imi2b interrupt requested by imf2b is enabled bit 0?input capture/compare-match interrupt enable (ime2a): enables or disables interrupt requests by imf2a in tsr when imf2a is set to 1. bit 0: ime2a description 0 imi2a interrupt requested by imf2a is disabled (initial value) 1 imi2a interrupt requested by imf2a is enabled timer interrupt enable registers dh and dl (tierdh, tierdl) tierdh controls enabling/disabling of channel 3 input capture, compare-match, and overflow interrupt requests. bit:76543210 ??? ove3 ime3d ime3c ime3b ime3a initial value:00000000 r/w: r r r r/w r/w r/w r/w r/w bits 7 to 5?reserved: these bits are always read as 0, and should only be written with 0. bit 4?overflow interrupt enable (ove3): enables or disables interrupt requests by ovf3 in tsr when ovf3 is set to 1. bit 4: ove3 description 0 ovi3 interrupt requested by ovf3 is disabled (initial value) 1 ovi3 interrupt requested by ovf3 is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 258 of 818 rej09b0273-0500 bit 3?input capture/compare-match interrupt enable (ime3d): enables or disables interrupt requests by imf3d in tsr when imf3d is set to 1. bit 3: ime3d description 0 imi3d interrupt requested by imf3d is disabled (initial value) 1 imi3d interrupt requested by imf3d is enabled bit 2?input capture/compare-match interrupt enable (ime3c): enables or disables interrupt requests by imf3c in tsr when imf3c is set to 1. bit 2: ime3c description 0 imi3c interrupt requested by imf3c is disabled (initial value) 1 imi3c interrupt requested by imf3c is enabled bit 1?input capture/compare-match interrupt enable (ime3b): enables or disables interrupt requests by imf3b in tsr when imf3b is set to 1. bit 1: ime3b description 0 imi3b interrupt requested by imf3b is disabled (initial value) 1 imi3b interrupt requested by imf3b is enabled bit 0?input capture/compare-match interrupt enable (ime3a): enables or disables interrupt requests by imf3a in tsr when imf3a is set to 1. bit 0: ime3a description 0 imi3a interrupt requested by imf3a is disabled (initial value) 1 imi3a interrupt requested by imf3a is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 259 of 818 rej09b0273-0500 tierdl controls enabling/disabling of channel 4 and 5 input capture, compare-match, and overflow interrupt requests. bit:76543210 ove4 ime4d ime4c ime4b ime4a ove5 ime5b ime5a initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit 7?overflow interrupt enable (ove4): enables or disables interrupt requests by ovf4 in tsr when ovf4 is set to 1. bit 7: ove4 description 0 ovi4 interrupt requested by ovf4 is disabled (initial value) 1 ovi4 interrupt requested by ovf4 is enabled bit 6?input capture/compare-match interrupt enable (ime4d): enables or disables interrupt requests by imf4d in tsr when imf4d is set to 1. bit 6: ime4d description 0 imi4d interrupt requested by imf4d is disabled (initial value) 1 imi4d interrupt requested by imf4d is enabled bit 5?input capture/compare-match interrupt enable (ime4c): enables or disables interrupt requests by imf4c in tsr when imf4c is set to 1. bit 5: ime4c description 0 imi4c interrupt requested by imf4c is disabled (initial value) 1 imi4c interrupt requested by imf4c is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 260 of 818 rej09b0273-0500 bit 4?input capture/compare-match interrupt enable (ime4b): enables or disables interrupt requests by imf4b in tsr when imf4b is set to 1. bit 4: ime4b description 0 imi4b interrupt requested by imf4b is disabled (initial value) 1 imi4b interrupt requested by imf4b is enabled bit 3?input capture/compare-match interrupt enable (ime4a): enables or disables interrupt requests by imf4a in tsr when imf4a is set to 1. bit 3: ime4a description 0 imi4a interrupt requested by imf4a is disabled (initial value) 1 imi4a interrupt requested by imf4a is enabled bit 2?overflow interrupt enable (ove5): enables or disables interrupt requests by ovf5 in tsr when ovf5 is set to 1. bit 2: ove5 description 0 ovi5 interrupt requested by ovf5 is disabled (initial value) 1 ovi5 interrupt requested by ovf5 is enabled bit 1?input capture/compare-match interrupt enable (ime5b): enables or disables interrupt requests by imf5b in tsr when imf5b is set to 1. bit 1: ime5b description 0 imi5b interrupt requested by imf5b is disabled (initial value) 1 imi5b interrupt requested by imf5b is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 261 of 818 rej09b0273-0500 bit 0?input capture/compare-match interrupt enable (ime5a): enables or disables interrupt requests by imf5a in tsr when imf5a is set to 1. bit 0: ime5a description 0 imi5a interrupt requested by imf5a is disabled (initial value) 1 imi5a interrupt requested by imf5a is enabled timer interrupt enable register e (tiere) tiere controls enabling/disabling of channel 6 to 9 cycle register compare interrupt requests. bit:76543210 ? cme6 ? cme7 ? cme8 ? cme9 initial value:00000000 r/w:rr/wrr/wrr/wrr/w bit 7?reserved: this bit is always read as 0, and should only be written with 0. bit 6?cycle register compare-match interrupt enable (cme6): enables or disables interrupt requests by cmf6 in tsr when cmf6 is set to 1. bit 6: cme6 description 0 cmi6 interrupt requested by cmf6 is disabled (initial value) 1 cmi6 interrupt requested by cmf6 is enabled bit 5?reserved: this bit is always read as 0, and should only be written with 0. bit 4?cycle register compare-match interrupt enable (cme7): enables or disables interrupt requests by cmf7 in tsr when cmf7 is set to 1. bit 4: ome7 description 0 cmi7 interrupt requested by cmf7 is disabled (initial value) 1 cmi7 interrupt requested by cmf7 is enabled bit 3?reserved: this bit is always read as 0, and should only be written with 0.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 262 of 818 rej09b0273-0500 bit 2?cycle register compare-match interrupt enable (cme8): enables or disables interrupt requests by cmf8 in tsr when cmf8 is set to 1. bit 2: cme8 description 0 cmi8 interrupt requested by cmf8 is disabled (initial value) 1 cmi8 interrupt requested by cmf8 is enabled bit 1?reserved: this bit is always read as 0, and should only be written with 0. bit 0?cycle register compare-match interrupt enable (cme9): enables or disables interrupt requests by cmf9 in tsr when cmf9 is set to 1. bit 0: cme9 description 0 cmi9 interrupt requested by cmf9 is disabled (initial value) 1 cmi9 interrupt requested by cmf9 is enabled timer interrupt enable register f (tierf) tierf controls enabling/disabling of channel 10 one-shot pulse interrupt requests. bit:76543210 ose10h ose10g ose10f ose10e ose10d ose10c ose10b ose10a initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit 7?one-shot pulse interrupt enable (ose10h): enables or disables interrupt requests by osf10h in tsr when osf10h is set to 1. bit 7: ose10h description 0 osi10h interrupt requested by osf10h is disabled (initial value) 1 osi10h interrupt requested by osf10h is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 263 of 818 rej09b0273-0500 bit 6?one-shot pulse interrupt enable (ose10g): enables or disables interrupt requests by osf10g in tsr when osf10g is set to 1. bit 6: ose10g description 0 osi10g interrupt requested by osf10g is disabled (initial value) 1 osi10g interrupt requested by osf10g is enabled bit 5?one-shot pulse interrupt enable (ose10f): enables or disables interrupt requests by osf10f in tsr when osf10f is set to 1. bit 5: ose10f description 0 osi10f interrupt requested by osf10f is disabled (initial value) 1 osi10f interrupt requested by osf10f is enabled bit 4?one-shot pulse interrupt enable (ose10e): enables or disables interrupt requests by osf10e in tsr when osf10e is set to 1. bit 4: ose10e description 0 osi10e interrupt requested by osf10e is disabled (initial value) 1 osi10e interrupt requested by osf10e is enabled bit 3?one-shot pulse interrupt enable (ose10d): enables or disables interrupt requests by osf10d in tsr when osf10d is set to 1. bit 3: ose10d description 0 osi10d interrupt requested by osf10d is disabled (initial value) 1 osi10d interrupt requested by osf10d is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 264 of 818 rej09b0273-0500 bit 2?one-shot pulse interrupt enable (ose10c): enables or disables interrupt requests by osf10c in tsr when osf10c is set to 1. bit 2: ose10c description 0 osi10c interrupt requested by osf10c is disabled (initial value) 1 osi10c interrupt requested by osf10c is enabled bit 1?one-shot pulse interrupt enable (ose10b): enables or disables interrupt requests by osf10b in tsr when osf10b is set to 1. bit 1: ose10b description 0 osi10b interrupt requested by osf10b is disabled (initial value) 1 osi10b interrupt requested by osf10b is enabled bit 0?one-shot pulse interrupt enable (ose10a): enables or disables interrupt requests by osf10a in tsr when osf10a is set to 1. bit 0: ose10a description 0 osi10a interrupt requested by osf10a is disabled (initial value) 1 osi10a interrupt requested by osf10a is enabled 10.2.9 interval interrupt request register (itvrr) the interval interrupt request register (itvrr) is an 8-bit register. the atu has one itvrr register in channel 0. bit:76543210 itvad3 itvad2 itvad1 itvad0 itve3 itve2 itve1 itve0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w itvrr is an 8-bit readable/writable register used for channel 0 interval interrupt bit setting. itvrr is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 265 of 818 rej09b0273-0500 bit 7?a/d converter interval activation bit 3 (itvad3): a/d converter activation setting bit corresponding to bit 13 in free running counter 0l (tcnt0l). the rise of bit 13 in tcnt0l is anded with itvad3, and the result is output to the a/d converter as an activation signal. bit 7: itvad3 description 0 a/d converter activation by atu is disabled (initial value) 1 a/d converter activation by atu is enabled bit 6?a/d converter interval activation bit 2 (itvad2): a/d converter activation setting bit corresponding to bit 12 in tcnt0l. the rise of bit 12 in tcnt0l is anded with itvad2, and the result is output to the a/d converter as an activation signal. bit 6: itvad2 description 0 a/d converter activation by atu is disabled (initial value) 1 a/d converter activation by atu is enabled bit 5?a/d converter interval activation bit 1 (itvad1): a/d converter activation setting bit corresponding to bit 11 in tcnt0l. the rise of bit 11 in tcnt0l is anded with itvad1, and the result is output to the a/d converter as an activation signal. bit 5: itvad1 description 0 a/d converter activation by atu is disabled (initial value) 1 a/d converter activation by atu is enabled bit 4?a/d converter interval activation bit 0 (itvad0): a/d converter activation setting bit corresponding to bit 10 in tcnt0l. the rise of bit 10 in tcnt0l is anded with itvad0, and the result is output to the a/d converter as an activation signal. bit 4: itvad0 description 0 a/d converter activation by atu is disabled (initial value) 1 a/d converter activation by atu is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 266 of 818 rej09b0273-0500 bit 3?interval interrupt bit 3 (itve3): interrupt controller (intc) interval interrupt setting bit corresponding to bit 13 in tcnt0l. the rise of bit 13 in tcnt0l is anded with itve3, the result is stored in iif3 in the timer status register (tsrah), and an interrupt request is sent to intc. bit 3: itve3 description 0 atu interval interrupt generation is disabled (initial value) 1 generation of interval interrupt to intc is enabled bit 2?interval interrupt bit 2 (itve2): intc interval interrupt setting bit corresponding to bit 12 in tcnt0l. the rise of bit 12 in tcnt0l is anded with itve2, the result is stored in iif2 in tsrah, and an interrupt request is sent to intc. bit 2: itve2 description 0 atu interval interrupt generation is disabled (initial value) 1 generation of interval interrupt to intc is enabled bit 1?interval interrupt bit 1 (itve1): intc interval interrupt setting bit corresponding to bit 11 in tcnt0l. the rise of bit 11 in tcnt0l is anded with itve1, the result is stored in iif1 in tsrah, and an interrupt request is sent to intc. bit 1 itve1 description 0 atu interval interrupt generation is disabled (initial value) 1 generation of interval interrupt to intc is enabled bit 0?interval interrupt bit 0 (itve0): intc interval interrupt setting bit corresponding to bit 10 in tcnt0l. the rise of bit 10 in tcnt0l is anded with itve0, the result is stored in iif0 in tsrah, and an interrupt request is sent to intc. bit 0: itve0 description 0 atu interval interrupt generation is disabled (initial value) 1 generation of interval interrupt to intc is enabled for details, see section 10.3.7, interval timer operation.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 267 of 818 rej09b0273-0500 10.2.10 down-count start register (dstr) the down-count start register (dstr) is an 8-bit register. the atu has one dstr register in channel 10. bit:76543210 dst10h dst10g dst10f dst10e dst10d dst10c dst10b dst10a initial value:00000000 r/w: r/w * r/w * r/w * r/w * r/w * r/w * r/w * r/w * note: * only 1 can be written. dstr is an 8-bit readable/writable register that starts and stops the channel 10 down-counter (dcnt). when the one-shot pulse function is used, a value of 1 can be set in a dst10 bit at any time by the user program. the dst10 bits are cleared to 0 automatically when the dcnt value underflows. when the offset one-shot pulse function is used, a dst10 bit is automatically set to 1 when a compare-match occurs between the channel 1 or 2 free-running counter (tcnt) and a general register (gr) while the corresponding timer connection register (tcnr) bit is set to 1. the bit is automatically cleared to 0 when the dcnt value underflows. a value of 1 can be set in a dst10 bit at any time by the user program. dstr is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode. for details, see sections 10.3.5, one-shot pulse function, and 10.3.6, offset one-shot pulse function.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 268 of 818 rej09b0273-0500 bit 7?down-count start flag 10h (dst10h): starts and stops down-counter 10h (dcnt10h). bit 7: dst10h description 0 dcnt10h is halted [clearing condition] when the dcnt10h value underflows (initial value) 1 dcnt10h counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set on gr2b compare-match, or by user program bit 6?down-count start flag 10g (dst10g): starts and stops down-counter 10g (dcnt10g). bit 6: dst10g description 0 dcnt10g is halted [clearing condition] when the dcnt10g value underflows (initial value) 1 dcnt10g counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set on gr2a compare-match, or by user program
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 269 of 818 rej09b0273-0500 bit 5?down-count start flag 10f (dst10f): starts and stops down-counter 10f (dcnt10f). bit 5: dst10f description 0 dcnt10f is halted [clearing condition] when the dcnt10f value underflows (initial value) 1 dcnt10f counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set on gr1f compare-match, or by user program bit 4?down-count start flag 10e (dst10e): starts and stops down-counter 10e (dcnt10e). bit 4: dst10e description 0 dcnt10e is halted [clearing condition] when the dcnt10e value underflows (initial value) 1 dcnt10e counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set on gr1e compare-match, or by user program bit 3?down-count start flag 10d (dst10d): starts and stops down-counter 10d (dcnt10d). bit 3: dst10d description 0 dcnt10d is halted [clearing condition] when the dcnt10d value underflows (initial value) 1 dcnt10d counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set on gr1d compare-match, or by user program
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 270 of 818 rej09b0273-0500 bit 2?down-count start flag 10c (dst10c): starts and stops down-counter 10c (dcnt10c). bit 2: dst10c description 0 dcnt10c is halted [clearing condition] when the dcnt10c value underflows (initial value) 1 dcnt10c counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set on gr1c compare-match, or by user program bit 1?down-count start flag 10b (dst10b): starts and stops down-counter 10b (dcnt10b). bit 1: dst10b description 0 dcnt10b is halted [clearing condition] when the dcnt10b value underflows (initial value) 1 dcnt10b counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set on gr1b compare-match, or by user program
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 271 of 818 rej09b0273-0500 bit 0?down-count start flag 10a (dst10a): starts and stops down-counter 10a (dcnt10a). bit 0: dst10a description 0 dcnt10a is halted [clearing condition] when the dcnt10a value underflows (initial value) 1 dcnt10a counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set on gr1a compare-match, or by user program 10.2.11 timer connection register (tcnr) the timer connection register (tcnr) is an 8-bit register. the atu has one tcnr register in channel 10. bit:76543210 cn10h cn10g cn10f cn10e cn10d cn10c cn10b cn10a initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w tcnr is an 8-bit readable/writable register that enables or disables connection between the channel 10 down-counter start register (dstr) and channel 1 and 2 compare-match signals. tcnr is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode. for details, see sections 10.3.5, one-shot pulse function, and 10.3.6, offset one-shot pulse function.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 272 of 818 rej09b0273-0500 bit 7?connection flag 10h (cn10h): enables or disables connection between dst10h and channel 2 compare-match signal off2b. bit 7: cn10h description 0 connection between dst10h and off2b is disabled (initial value) 1 connection between dst10h and off2b is enabled bit 6?connection flag 10g (cn10g): enables or disables connection between dst10g and channel 2 compare-match signal off2a. bit 6: cn10g description 0 connection between dst10g and off2a is disabled (initial value) 1 connection between dst10g and off2a is enabled bit 5?connection flag 10f (cn10f): enables or disables connection between dst10f and channel 1 compare-match signal off1f. bit 5: cn10f description 0 connection between dst10f and off1f is disabled (initial value) 1 connection between dst10f and off1f is enabled bit 4?connection flag 10e (cn10e): enables or disables connection between dst10e and channel 1 compare-match signal off1e. bit 4: cn10e description 0 connection between dst10e and off1e is disabled (initial value) 1 connection between dst10e and off1e is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 273 of 818 rej09b0273-0500 bit 3?connection flag 10d (cn10d): enables or disables connection between dst10d and channel 1 compare-match signal off1d. bit 3: cn10d description 0 connection between dst10d and off1d is disabled (initial value) 1 connection between dst10d and off1d is enabled bit 2?connection flag 10c (cn10c): enables or disables connection between dst10c and channel 1 compare-match signal off1c. bit 2: cn10c description 0 connection between dst10c and off1c is disabled (initial value) 1 connection between dst10c and off1c is enabled bit 1?connection flag 10b (cn10b): enables or disables connection between dst10b and channel 1 compare-match signal off1b. bit 1: cn10b description 0 connection between dst10b and off1b is disabled (initial value) 1 connection between dst10b and off1b is enabled bit 0?connection flag 10a (cn10a): enables or disables connection between dst10a and channel 1 compare-match signal off1a. bit 0: cn10a description 0 connection between dst10a and off1a is disabled (initial value) 1 connection between dst10a and off1a is enabled
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 274 of 818 rej09b0273-0500 10.2.12 free-running counters (tcnt) the free-running counters (tcnt) are 32- or 16-bit up-counters. the atu has ten tcnt counters: one 32-bit tcnt in channel 0, and one 16-bit tcnt in each of channels 1 to 9. channel abbreviation description 0 tcnt0h, tcnt0l 32-bit up-counter (initial value h'00000000) 1 tcnt1 16-bit up-counters (initial value h'0000) 2 tcnt2 3 tcnt3 4 tcnt4 5 tcnt5 6 tcnt6 16-bit up-counters (initial value h'0001) 7 tcnt7 8 tcnt8 9 tcnt9 free-running counter 0h, l (tcnt0h, tcnt0l): free-running counter 0 (comprising tcnt0h and tcnt0l) is a 32-bit readable/writable register that counts on an input clock. the input clock is selected with prescaler register 1 (pscr1). bit: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit:1514131211109876543210 initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w when tcnt0 overflows (from h'ffffffff to h'00000000), the ovf0 overflow flag in the timer status register (tsr) is set to 1. tcnt0 is connected to the cpu via an internal 16-bit bus, and can only be accessed by a longword read or write. word reads or writes cannot be used..
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 275 of 818 rej09b0273-0500 tcnt0 is initialized to h'00000000 by a power-on reset, and in hardware standby mode and software standby mode. free-running counters 1 to 5 (tcnt1 to tcnt5): free-running counters 1 to 5 (tcnt1 to tcnt5) are 16-bit readable/writable registers that count on an input clock. the input clock is selected with prescaler register 1 (pscr1) and the timer control register (tcr). bit:1514131211109876543210 initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w tcnt3 to tcnt5 can be cleared to h'0000 by a compare-match with the corresponding general register (gr) or input capture (counter clear function). when one of counters tcnt1 to tcnt5 overflows (from h'ffff to h'0000), the overflow flag (ovf) for the corresponding channel in the timer status register (tsr) is set to 1. tcnt1 to tcnt5 are connected to the cpu via an internal 16-bit bus, and can only be accessed by a word read or write. tcnt1 to tcnt5 are initialized to h'0000 by a power-on reset, and in hardware standby mode and software standby mode. free-running counters 6 to 9 (tcnt6 to tcnt9): free-running counters 6 to 9 (tcnt6 to tcnt9) are 16-bit readable/writable registers that count on an input clock. the input clock is selected with prescaler register 1 (pscr1) and the timer control register (tcr). bit:1514131211109876543210 initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w tcnt6 to tcnt9 are connected to the cpu via an internal 16-bit bus, and can only be accessed by a word read or write. tcnt6 to tcnt9 are initialized to h'0001 by a power-on reset, and in hardware standby mode and software standby mode.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 276 of 818 rej09b0273-0500 10.2.13 input capture registers (icr) the input capture registers (icr) are 32-bit registers. the atu has four 32-bit icr registers in channel 0. channel abbreviation function 0 icr0ah, icr0al, icr0bh, icr0bl, icr0ch, icr0cl, icr0dh, icr0dl dedicated input capture registers input capture registers 0ah, 0al to 0dh, 0dl (icr0ah, icr0al to icr0dh, icr0dl) bit: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 initial value:0000000000000000 r/w:rrrrrrrrrrrrrrrr bit:1514131211109876543210 initial value:0000000000000000 r/w:rrrrrrrrrrrrrrrr the icr registers are 32-bit read-only registers used exclusively for input capture. these dedicated input capture registers store the tcnt0 value on detection of an input capture signal from an external source. the corresponding tsr bit is set to 1 at this time. the input capture signal edge to be detected is specified by timer i/o control register tior0a. icr0a and icr0d can detect an external input capture (tia0) or the channel 1 general register (gr1a) compare-match signal (trg1a) as an input capture signal. the icr registers are connected to the cpu via an internal 16-bit bus, and can only be accessed by a longword read. word reads cannot be used. the icr registers are initialized to h'00000000 by a power-on reset, and in hardware standby mode and software standby mode.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 277 of 818 rej09b0273-0500 10.2.14 general registers (gr) the general registers (gr) are 16-bit registers. the atu has 18 general registers: six in channel 1, two in channel 2, four each in channels 3 and 4, and two in channel 5. channel abbreviation function 1gr1a, gr1b, gr1c, gr1d, gr1e, gr1f dual-purpose input capture and output compare registers 2gr2a, gr2b 3gr3a, gr3b, gr3c, gr3d 4gr4a, gr4b, gr4c, gr4d 5gr5a, gr5b general registers 1a to 1f (gr1a to gr1f) bit:1514131211109876543210 initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the gr registers are 16-bit readable/writable registers with both input capture and output compare functions. function switching is performed by means of the timer i/o control registers (tior). when a general register is used for input capture, it stores the tcnt value on detection of an input capture signal from an external source. the corresponding imf bit in tsr is set to 1 at this time. the input capture signal edge to be detected is specified by the corresponding tior. when a general register is used for output compare, the gr value and free-running counter (tcnt) value are constantly compared, and when both values match, the imf bit in the timer status register (tsr) is set to 1. compare-match output is specified by the corresponding tior. the gr registers are connected to the cpu via an internal 16-bit bus, and can only be accessed by a word read or write. the gr registers are initialized to h'ffff by a power-on reset, and in hardware standby mode and software standby mode.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 278 of 818 rej09b0273-0500 general registers 2a and 2b (gr2a and gr2b) bit:1514131211109876543210 initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w channel 2 compare-match signals can be transmitted to the advanced pulse controller (apc). for details, see section 11, advanced pulse controller (apc). general registers 3a to 3d, 4a to 4d, 5a, and 5b (gr3a to gr3d, gr4a to gr4d, gr5a, gr5b) bit:1514131211109876543210 initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w 10.2.15 down-counters (dcnt) the dcnt registers are 16-bit down-counters. the atu has eight dcnt counters in channel 10. channel abbreviation description 10 dcnt10a, dcnt10b, dcnt10c, dcnt10d, dcnt10e, dcnt10f, dcnt10g, dcnt10h down-counter down-counters 10a to 10h (dcnt10a to dcnt10h): down-counters 10a to 10h (dcnt10a to dcnt10h) are 16-bit readable/writable registers that count on an input clock. the input clock is selected with prescaler register 1 (pscr1) and the timer control register (tcr). bit:1514131211109876543210 initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 279 of 818 rej09b0273-0500 when the one-shot pulse function is used, dcnt starts counting down when the corresponding dstr bit is set to 1 by the user program after the dcnt value has been set. when the dcnt value underflows, the corresponding dstr bit and dcnt are automatically cleared to 0, and the count is stopped. at the same time, the corresponding channel 10 timer status register f (tsrf) status flag is set to 1. when the offset one-shot pulse function is used, on compare-match with a channel 1 or 2 general register (gr) when the corresponding timer connection register (tcnr) bit is 1, the corresponding down-count start register (dstr) bit is automatically set to 1 and the down-count is started. when the dcnt value underflows, the corresponding dstr bit and dcnt are automatically cleared to 0, and the count is stopped. at the same time, the corresponding channel 10 tsrf status flag is set to 1. the dcnt counters are connected to the cpu via an internal 16-bit bus, and can only be accessed by a word read or write. the dcnt counters are initialized to h'0000 by a power-on reset, and in hardware standby mode and software standby mode. for details, see sections 10.3.5, one-shot pulse function, and 10.3.6, offset one-shot pulse function. 10.2.16 offset base register (osbr) the offset base register (osbr) is a 16-bit register. the atu has one osbr register in channel 1. channel abbreviation function 1 osbr dedicated input capture register with signal from channel 0 icr0a as input trigger offset base register (osbr) bit: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 initial value:0000000000000000 r/w:rrrrrrrrrrrrrrrr osbr is a 16-bit read-only register used exclusively for input capture. osbr uses the channel 0 icr0a input capture register input as its trigger signal (trg0a), and stores the tcnt1 value on detection of the edge selected with bits 0 and 1 of tiora.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 280 of 818 rej09b0273-0500 osbr is connected to the cpu via an internal 16-bit bus, and can only be accessed by a word read. osbr is initialized to h'0000 by a power-on reset, and in hardware standby mode and software standby mode. for details, see sections 10.3.4, input capture function. 10.2.17 cycle registers (cylr) the cycle registers (cylr) are 16-bit registers. the atu has four cycle registers, one each for channels 6 to 9. channel abbreviation function 6 cylr6 cycle registers 7cylr7 8cylr8 9cylr9 cycle registers (cylr6 to cylr9) bit:1514131211109876543210 initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the cylr registers are 16-bit readable/writable registers used for pwm cycle storage. the cylr value is constantly compared with the corresponding free-running counter (tcnt6 to tcnt9) value, and when the two values match, the corresponding timer start register (tsr) bit (cmf6 to cmf9) is set to 1, and the free-running counter (tcnt6 to tcnt9) is cleared. at the same time, the buffer register (bfr) value is transferred to the duty register (dtr). the cylr registers are connected to the cpu via an internal 16-bit bus, and can only be accessed by a word read or write. the cylr registers are initialized to h'ffff by a power-on reset, and in hardware standby mode and software standby mode. for details of the cylr, bfr, and dtr registers, see sections 10.3.9, pwm timer function.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 281 of 818 rej09b0273-0500 10.2.18 buffer registers (bfr) the buffer registers (bfr) are 16-bit registers. the atu has four buffer registers, one each for channels 6 to 9. channel abbreviation function 6 bfr6 buffer registers 7bfr7 8bfr8 9bfr9 buffer registers (bfr6 to bfr9) bit:1514131211109876543210 initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the bfr registers are 16-bit readable/writable registers that store the value to be transferred to the duty register (dtr) in the event of a cycle register (cylr) compare-match. the bfr registers are connected to the cpu via an internal 16-bit bus, and can only be accessed by a word read or write. the bfr registers are initialized to h'ffff by a power-on reset, and in hardware standby mode and software standby mode.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 282 of 818 rej09b0273-0500 10.2.19 duty registers (dtr) the duty registers (dtr) are 16-bit registers. the atu has four duty registers, one each for channels 6 to 9. channel abbreviation function 6 dtr6 duty registers 7dtr7 8dtr8 9dtr9 duty registers (dtr6 to dtr9) bit:1514131211109876543210 initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the dtr registers are 16-bit readable/writable registers used for pwm duty storage. the dtr value is constantly compared with the corresponding free-running counter (tcnt6 to tcnt9) value, and when the two values match, the corresponding channel output pin (to6 to to9) goes to 0 output. the dtr registers are connected to the cpu via an internal 16-bit bus, and can only be accessed by a word read or write. the dtr registers are initialized to h'ffff by a power-on reset, and in hardware standby mode and software standby mode.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 283 of 818 rej09b0273-0500 10.3 operation 10.3.1 overview the atu has eleven timers of seven kinds in channels 0 to 10. it also has a built-in prescaler that generates input clocks, and it is possible to generate or select internal clocks of the required frequency independently of circuitry outside the atu. the operation of each channel and the prescaler is outlined below. channel 0 (32-bit dedicated input capture timer): channel 0 has a 32-bit free-running counter (tcnt0) and four 32-bit input capture registers (icr0a to icr0d). tcnt0 is an up- counter that performs free-running operation. the four input capture registers (icr0a to icr0d) can be used for input capture with input from the corresponding external signal input pin (tia0 to tid0) or output compare-match trigger input from channel 1 gr1a. input pin (tia0 to tid0) and gr1a output compare-match trigger selection can be made by setting the trigger selection register (tgsr). channel 0 also has an interval interrupt request register (itvrr). when 1 is set in itve0 to itve3 in itvrr, an interval timer function can be used whereby an interrupt request can be sent to the cpu when the corresponding bit (of bits 10 to 13) in tcnt0 changes to 1. channels 1 and 2: atu channel 1 has a 16-bit free-running counter (tcnt1) and six 16-bit general registers (gr1a to gr1f). tcnt1 is an up-counter that performs free-running operation. the six general registers (gr1a to gr1f) can be used as input capture or output compare-match registers using the corresponding external signal i/o pin (tioa0 to tiof0). use as a one-shot pulse offset function is also possible in combination with atu channel 10 described below. channel 2 has a 16-bit free-running counter (tcnt2) and two 16-bit general registers (gr2a and gr2b). channel 2 can perform the same kind of operations as channel 1, the only difference being in the number of general registers. in addition, channel 1 has a 16-bit dedicated input capture register (osbr) (not provided in channel 2). the tia0 external pin for input to channel 0 can also be used as the osbr trigger input, enabling use of a twin-capture function.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 284 of 818 rej09b0273-0500 channels 3, 4, and 5: atu channels 3 and 4 each have a 16-bit free-running counter (tcnt3, tcnt4) and four 16-bit general registers (gr3a to gr3d, gr4a to gr4d). tcnt3 and tcnt4 are up-counters that perform free-running operation. the four general registers (gr3a to gr3d, gr4a to gr4d) each have corresponding external signal i/o pins (tioa3 to tiod3, tioa4 to tiod4, tioa5, tiob5), and can be used as input capture or output compare-match registers. with channels 3 and 4, gr3d and gr4d are automatically designated as cycle registers by setting pwm mode in the timer mode register (tmdr). in pwm mode, the counter is automatically cleared by an output compare-match when the gr3d/gr4d value matches the tcnt3/tcnt4 value. therefore, channels 3 and 4 can each be used as 3-channel pwm timers, with gr3a to gr3c or gr4a to gr4c as the duty registers, and gr3d or gr4d as the cycle register. channel 5 has a 16-bit counter (tcnt5) and two 16-bit general registers (gr5a and gr5b). channel 5 can perform the same kind of operations as channel 3, the only difference being in the number of general registers. in pwm mode, gr5a is designated as the duty register and gr5b as the cycle register. channels 6, 7, 8, and 9 (dedicated pwm timers): atu channels 6 to 9 each have a 16-bit free- running counter (tcnt6 to tcnt9), 16-bit cycle register (cylr6 to cylr9), 16-bit duty register dtr6 to dtr9), and buffer register (bfr6 to bfr9). each of channels 6 to 9 also has an external output pin (to6 to to9), and can be used as a buffered pwm timer. tcnt6 to tcnt9 are up-counters, and 0 is output to the corresponding external output pin when the tcnt value matches the dtr value (when dtr channel 10: atu channel 10 has eight 16-bit down-counters (dcnt10a to dcnt10h), and corresponding external output pins (toa10 to toh10). one-shot pulse output can be performed by setting the dcnt value, starting dcnt operation in the user program and outputting 1 to the external output pin, then halting the count operation when dcnt underflows, and outputting 0 to the external output pin. by coupling the operation with the channel 1 or channel 2 output compare function, offset one- shot pulse output can be performed, whereby a one-shot pulse is generated by starting dcnt
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 285 of 818 rej09b0273-0500 operation in response to a compare-match signal and outputting 1 to the external output pin, then halting the count operation when dcnt underflows, and outputting 0. prescaler: the atu has a dedicated prescaler with a 2-stage configuration. the first prescaler stage includes a 5-bit prescaler register (pscr1) that allows any scaling factor from 1 to 1/32 to be specified. the first prescaler stage supplies a clock ( 10.3.2 free-running count operation and cyclic count operation the atu channel 0 to 5 free-running counters (tcnt) are all designated as free-running counters immediately after a reset, and start counting up as free-running counters when the corresponding tstr bit is set to 1. when tcnt overflows (channel 0: from h'ffffffff to h'00000000; channels 1 to 5: from h'ffff to h'0000), the ovf bit in the timer status register (tsr) is set to 1. if the ove bit in the corresponding timer interrupt enable register (tier) is set to 1 at this time, an interrupt request is sent to the cpu. after overflowing, tcnt starts counting up again from h'00000000 or h'0000. if the timer start register (tstr) value is cleared to 0 during the count, only the corresponding free-running counter (tcnt) stops counting, and initialization of all tcnt counters and atu registers is not performed. the value at the point at which the tstr value is cleared to 0 continues to be output externally. free-running counter operation is shown in figure 10.11. (for channel 0: h'00000000 to h'ffffffff) time h'ffff h'0000 ovf str bit in tstr figure 10.11 free-running counter operation
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 286 of 818 rej09b0273-0500 the atu channel 6 to 9 counters (tcnt) all perform cyclic count operations unconditionally. atu channel 3 to 5 free-running counters (tcnt) perform synchronous count operation when 1 is set in bits t3pwm to t5pwm in the timer mode register (tmdr). these free-running counters also perform synchronous count operation if the corresponding cci bit in the timer i/o control register (tior) is set to 1 when bits t3pwm to t5pwm are 0. the relevant tcnt counter is cleared by a compare-match of tcnt with gr3d or gr4d in channel 3 or 4, gr5b in channel 5, or cylr in channels 6 to 9 (counter clear function). in this way, cyclic counting is performed. tcnt starts counting up as a cyclic counter when the corresponding str bit in tstr is set to 1 after the tmdr setting is made. when the count value matches the gr3d, gr4d, gr5b, or cylr value, the corresponding imf3d, imf4d, or imf5b bit in timer status register d (tsrd) (or the cmf bit in tsre for channels 6 to 9) is set to 1, and tcnt is cleared to h'0000 (h'0001 for channels 6 to 9). if the corresponding tier bit is set to 1 at this time, an interrupt request is sent to the cpu. after the compare-match, tcnt starts counting up again from h'0000 (h'0001 for channels 6 to 9). cyclic counter operation is shown in figure 10.12. counter cleared on compare-match time gr3d, gr4d, gr5b, cylr imf3d, imf4d, imf5b, cmf h'0000 (channels 6 to 9: h'0001) str bit in tstr figure 10.12 cyclic counter operation 10.3.3 output compare-match function in atu channels 1 to 5, waveform output is performed by means of output compare-matches at the corresponding external pin (tioa1 to tiof1, tioa2, tiob2, tioa3 to tiod3, tio4a to tiod4, tioa5, tiob5) by making an output compare-match specification for the timer i/o control registers (tior0 to tior5). a free-running counter (tcnt) starts counting up when 1 is set in the timer status register (tstr). when the desired number is set beforehand in a general register (gr1a to gr1f, gr2a, gr2b, gr3a to gr3d, gr4a to gr4d, gr5a, gr5b), and the counter value matches the corresponding general register, a waveform is output from the corresponding external pin.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 287 of 818 rej09b0273-0500 external output value selection and counter clear function (channels 3 to 5 only) specification can be performed with the timer i/o control register (tior). 1 output, 0 output, or toggle output can be selected as the external output value. when the counter clear function is specified, the relevant tcnt is cleared to h'0000 by a compare-match between the corresponding general register and tcnt. if the appropriate interrupt enable register (tier) setting is made, an interrupt request will be sent to the cpu when an output compare-match occurs. an example of free-running counter and output compare-match operation is shown in figure 10.13. in the example in figure 10.13, atu channel 1 is activated, and external output is performed with 1 output specified in the event of gr1a output compare-match, 0 output in the event of gr1b output compare-match, and toggle output in the event of gr1c output compare-match. counter value tcnt1 time no change no change h'ffff gr1a gr1b gr1c h'0000 tioa1 (1 output) tiob1 (0 output) tioc1 (toggle output) no change figure 10.13 example of output compare-match operation
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 288 of 818 rej09b0273-0500 10.3.4 input capture function in atu channels 0 to 5, when input capture is specified for the timer i/o control register (tior), an input capture trigger signal is input from the corresponding external pin (tia0 to tid0, tioa1 to tiof1, tioa2, tiob2, tioa3 to tiod3, tio4a to tiod4, tioa5, tiob5). a free-running counter (tcnt) starts counting up when 1 is set in the timer start register (tstr). when a trigger signal is input from one of the above external pins, the counter value is transferred to the corresponding register (icr0ah/l to icr0dh/l, osbr, gr1a to gr1f, gr2a, gr2b, gr3a to gr3d, gr4a to gr4d, gr5a, gr5b). the detected edge of the external trigger input data can be selected by making a setting in the timer i/o control register (tior). rising-edge, falling-edge, or both-edge detection can be selected. a cpu interrupt request can be issued if the appropriate setting is made in the interrupt enable register (tier). an example of free-running counter and input capture operation is shown in figure 10.14. in the example in figure 10.14, atu channel 1 is activated, and input capture operation is performed with rising-edge detection specified for tioa1 and both-edge detection for tiob1. time counter value tcnt1 h'ffff (32 bits in case of channel 0) h'ffff (32 bits in case of channel 0) str1 tioa1 tiob1 gr1a gr1b h'ffff data 1 data 1 data 2 data 2 data 3 data 3 data 4 data 4 h'0000 (32 bits in case of channel 0) figure 10.14 example of input capture operation
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 289 of 818 rej09b0273-0500 10.3.5 one-shot pulse function atu channel 10 has eight down-counters (dcnt10a to dcnt10h) and corresponding external pins (toa10 to toh10) which can be used as one-shot pulse output pins. to generate a one-shot pulse, the one-shot pulse width is set in the down-counter (dcnt), and the corresponding down-count start register (dstr) bit (dst10a to dst10h) is set to 1 by the user program to start the down-count using the clock specified in the timer control register (tcr). when the down-count starts, 1 is output to the corresponding external pin (toa10 to toh10). if the dcnt value is 0, however, the external pin remains at 0 even if dst is set to 1; in this case, a one-shot pulse is not generated, but an interrupt is requested. when the dcnt value underflows, dcnt and the relevant dst bit are automatically cleared to 0, and dcnt stops counting. at the same time, 0 is output to the corresponding external pin. by making the appropriate setting in timer interrupt enable register f (tierf), an interrupt request can be sent to the cpu when the corresponding down-counter (dcnt10a to dcnt10h) reaches 0. it is possible to forcibly output 0 to the output pin during the down-count by clearing dcnt to 0 (since dst cannot be cleared to 0 by the user program). in this case, dcnt and the relevant dst bit are automatically cleared to 0 when the dcnt value underflows, and dcnt stops counting. at the same time, 0 is output to the corresponding external pin. an example of one-shot pulse operation is shown in figure 10.15. in the example in figure 10.15, one-shot pulse widths dataa and datab are set for dcnt10a by the user program, and one-shot pulse output is performed by writing 1 to dst10a.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 290 of 818 rej09b0273-0500 down-count value dcnt10a time dst10a = ? 1 ? (data b) (data a) dst10a= ? 1 ? one-shot pulse one-shot pulse automatically cleared to 0 h'ffff data b data a h'0000 dst10a write to dcnt10a and dst10a by user program toa10 figure 10.15 example of one-shot pulse operation 10.3.6 offset one-shot pulse function the atu channel 10 down-counters (dcnt) can be coupled with compare-matches between the channel 1 and 2 free-running counters (tcnt) and general registers (gr) by setting bits cn10a to cn10h to 1 in the timer connection register (tcnr). at the same time, the external pins (toa10 to toh10) corresponding to the eight channel 10 down-counters, dcnt10a to dcnt10h, can be used as offset one-shot pulse output pins. setting 1 in timer start register (tstr) bit str1 or str2 starts the up-count by tcnt1 or tcnt2 in channel 1 or 2. when tcnt1 or tcnt2 matches the general register (gr!a to gr1f, gr2a, gr2b) value, the down-count start register (dstr) bit corresponding to bit cn10a to cn10h in tcnr corresponding to gr automatically changes to 1, and the down-count is started. when the down-count starts, 1 is output to the corresponding external pin (toa10 to toh10). if the dcnt value is 0, however, the external pin remains at 0 even if dst is set to 1; in this case, a one-shot pulse is not generated, but an interrupt is requested. when the dcnt value underflows, dcnt and the relevant dst bit are automatically cleared to 0, and dcnt stops counting. at the same time, 0 is output to the corresponding external pin. as long as a count value is set in dcnt
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 291 of 818 rej09b0273-0500 from the cpu before the next match with the general register, one-shot pulses can be output consecutively. dstr cannot be rewritten while the offset one-shot pulse function is being used. by making the appropriate setting in timer interrupt enable register f (tierf), an interrupt request can be sent to the cpu one clock cycle after the corresponding down-counter (dcnt10a to dcnt10h) reaches 0. it is possible to forcibly output 0 to the output pin during the down-count by clearing dcnt to 0 (since dst cannot be cleared to 0 by the user program). in this case, dcnt and the relevant dst bit are automatically cleared to 0 when the dcnt value underflows, and dcnt stops counting. at the same time, 0 is output to the corresponding external pin. an example of offset one-shot pulse operation is shown in figure 10.16. in the example in figure 10.16, the atu channel 1 free-running counter is started, and offset one- shot pulse output is performed by means of gr1a output compare-match and the dcnt10a channel 10 down-counter corresponding to gr1a. time counter value tcnt1 (datab) (dataa) offset offset one-shot pulse one- shot pulse h'ffff gr1a h'0000 h'ffff write to gr1a write to dcnt10a by user program data b data a h'0000 toa10 down-count value dcnt10a figure 10.16 example of offset one-shot pulse operation
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 292 of 818 rej09b0273-0500 10.3.7 interval timer operation the 8 bits of the interval interrupt request register (itvrr) are connected to bits 10 to 13 of tcnt0l in the channel 0 32-bit free-running counter (tcnt0h, tcnt0l). the upper 4 bits (itvad3 to itvad0) are used to start a/d converter sampling, and the lower 4 bits (itve3 to itve0) generate signals to the interrupt controller (intc). for a/d converter activation, an edge sensor is provided for bits 10 to 13 of tcnt0l, and a/d channel 0 sampling is started when the corresponding bit in tcnt0l changes to 1 as a result of setting 1 in one of the upper 4 bits (itvad3 to itvad0) of itvrr. for generation of interrupt signals to the intc, after detection of bits 10 to 13 of tcnt0l by the edge sensor, when the corresponding bit in tcnt0l changes to 1 as a result of setting 1 in one of the lower 4 bits (itve3 to itve0) of itvrr after detection of bits 10 to 13 of tcnt0l by the edge sensor, the corresponding flag (iif0 to iif3) in timer status register tsrah is set to 1 and an interrupt request is sent to intc. the above four interrupt sources have only one interrupt vector address, and therefore when more than one of bits itve3 to itve0 in itvrr is specified, control branches to the same vector when any tcnt0 bit corresponding to one of the specified bits changes to 1. to suppress interrupts to intc, or to prevent a/d sampling from being started, all itvrr bits should be cleared to 0. a schematic diagram of the interval timer is shown in figure 10.17.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 293 of 818 rej09b0273-0500 atu upper 4 bits of itvrr lower 4 bits of itvrr tcnt0l (32 bit frt) edge sensor trsah (status flags) 13 12 11 10 bit a/d converter activation signal intc figure 10.17 schematic diagram of interval timer an example of tcnt0 and bit detection operation is shown in figure 10.18. in the example in figure 10.18, free-running counter 0 (tcnt0) is started by setting 1 in itve1 in itvrr.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 294 of 818 rej09b0273-0500 h'ffffffff h'fffff800 h'00002800 h'00001800 h'00000800 h'00000000 counter value tcnt0 cpu 0 write to iif1by user program interrupt status flag (iif1) time figure 10.18 example of interval timer operation 10.3.8 twin-capture function the atu ? s channel 0 icr0a and channel 1 osbr can be made to perform input capture in response to the same trigger by means of a setting in timer i/o control register tior0a. when the atu channel 0 counter (tcnt0) and channel 1 counter (tcnt1) are started by a setting in the timer status register (tsr), and a trigger signal is input from the icr0a input capture input pin (tia0), the tcnt0 value can be transferred to icr0a, and the tcnt1 value to osbr. rising- edge, falling-edge, or both-edge detection can be selected for the tia0 trigger input pin. by making the appropriate setting in the timer interrupt enable register (tier), an interrupt request can be sent to the cpu when input capture occurs. an example of twin-capture operation is shown in figure 10.19. in the example in figure 10.19, twin-capture is started using a both-edge detection specification.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 295 of 818 rej09b0273-0500 time time data x1 data y1 data x2 data y2 tia0 h'ffffffff data x1 data x2 h'00000000 h'ffff data y1 data y2 h'0000 icr0ah/l osbr channel 0 counter value tcnt0 channel 1 counter value tcnt1 figure 10.19 example of twin-capture operation 10.3.9 pwm timer function pwm mode is set unconditionally for atu channels 6 to 9, and also by setting 1 in the corresponding bit (t3pwm to t5pwm) of the atu channel 3 to 5 timer mode registers (tmdr), enabling the counters to be used as pwm timers. in atu channels 6 to 9, when the free-running counter (tcnt) is started, 0 is output to the external pin if the corresponding duty register (dtr6 to dtr9) value is 0, and 1 is output to the external pin if the dtr6 to dtr9 value is 1. when the tcnt count matches the dtr6 to dtr9 value after the up-count is started, 0 is output to the corresponding external pin (unless 100% duty has been set, in which case 1 is output). when the continuing tcnt up-count matches the cycle register (cylr) value, 1 is output to the corresponding external pin (unless 0% duty has been set, in which case 0 is output). at the same time, the counter is cleared. 0% duty is specified by setting dtr to h'0000, and 100% duty by setting dtr
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 296 of 818 rej09b0273-0500 an example of channel 6 to 9 pwm operation is shown in figure 10.20. in the example in figure 10.20, h'f000 is set in cylr6 to cylr8, h'f000 in dtr6, h'7000 in dtr7, and h'0000 in dtr8, atu channels 6 to 8 are activated simultaneously, and waveform output (100%, 50%, 0%) is generated on external pins to6 to to8. time no change no change no change no change no change counter value tcnt6 to tcnt8 h'ffff cylr6 ? 8, dtr6 (h'f000) dtr7 (h'7000) dtr8 (h'0000) to6 to7 to8 ( ? 0 ? ) figure 10.20 example of pwm waveform output operation in atu channels 3 to 5, when pwm mode is set, corresponding general register gr3d, gr4d, and gr5b function as cycle registers, and gr3a to gr3c, gr4a to gr4c, and gr5a, as duty registers. at the same time, external pins tioa3 to tioc3, tioa4 to tioc4, and tioa5 function as pwm waveform output pins. in channels 3 and 4, there are four duty registers for one cycle register, and the cycle is the same for all the corresponding output pins. in pwm mode, output of a 0% duty waveform cannot be set for atu channels 3 to 5. if 0% duty is required, channels 6 to 9 should be used. although constant 1 output is performed if 100% duty is set (gr3a, b, c
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 297 of 818 rej09b0273-0500 in the example in figure 10.21, h'f000 is set in gr3d, h'f000 in gr3a, h'7000 in gr3b, and h'0000 in gr3c, atu channel 3 is activated, and waveform output is generated on external pins tioa3 to tiod3. time no change no change counter value tcnt3 h'ffff gr3d, gr3a (h'f000) gr3b (h'7000) gr3c (h'0000) tioa3 tiob3 tioc3 figure 10.21 example of pwm waveform output operation 10.3.10 buffer function atu channels 6 to 9 each have a free-running counter (tcnt6 to tcnt9), cycle register (cylr6 to cylr9), duty register (dtr6 to dtr9), and buffer register (bfr6 to bfr9). pwm waveform output by means of counter matches with the cycle register and duty register is performed as described in section 10.3.9, pwm timer function. however, channels 6 to 9 also include a buffer function, whereby the corresponding buffer register value is transferred to the duty register on a match between the cycle register and counter. if the corresponding bit in timer interrupt enable register e (tiere) is set to 1, an interrupt request can be sent to the cpu when the cycle register value and counter value match. an example of buffered pwm operation is shown in figure 10.22. in the example in figure 10.22, h'4000 is set in bfr6, h'a000 in dtr6, and h'f000 in cylr6, and after the pwm operation is started, the bfr6 value is changed to h'b000 and h'7000 during
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 298 of 818 rej09b0273-0500 the operation, so that a waveform with varying duty cycles is output continuously on external pin to6. time duty register value dtr6 counter value tcnt6 h'ffff cylr6 (h'f000) dtr6 (h'a000) bfr6 (h'4000) h'0000 str6 bfr6 dtr6 to6 h'4000 h'a000 h'b000 h'4000 h'7000 h'b000 h'7000 h'7000 figure 10.22 example of buffered pwm waveform output operation 10.3.11 one-shot pulse function pulse output timing there is a maximum delay of one dcnt input clock count clock cycle between setting of the down-count start flag (dst) and the start of the dcnt down-count. one-shot pulse output also varies by a delay of one ck state, but there is no error in the one-shot pulse output pulse width. figure 10.23 shows an example with a pulse width setting of h'0005.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 299 of 818 rej09b0273-0500 h'0004 h'0003 h'0002 h'0001 h'0000 h'0000 h'0005 ck internal write signal 1 written to dst down-count start flag dst dcnt input clock dcnt one-shot pulse output 1 state 1 state dcnt start delay figure 10.23 one-shot pulse function pulse output timing 10.3.12 offset one-shot pulse function pulse output timing there is a delay of one ck state between the occurrence of a compare-match between the channel 1 or 2 free-running counter (tcnt) and a general register (gr), and setting of the channel 10 down-count start flag (dst) is set. in addition, there is a maximum delay of one dcnt input clock count clock cycle between setting of the dst flag and the start of the dcnt count. one- shot pulse output varies by a further delay of one ck state, but there is no error in the one-shot pulse output pulse width. figure 10.24 shows an example with an offset width setting of h'0100, and a pulse width setting of h'0003.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 300 of 818 rej09b0273-0500 ck tcnt input clock tcnt gr compare-match signal dcnt start delay down-count start flag dst dcnt input clock dcnt one-shot pulse output 1 state 1 state h'0100 h'0100 h'0101 h'0003 h'0002 h'0001 h'0000 h'0000 h'0102 h'0103 1 state figure 10.24 offset one-shot pulse function pulse output timing 10.3.13 channel 3 to 5 pwm output waveform actual cycle and actual duty in channel 3 to 5 pwm mode, the actual cycle corresponding to the cycle register value is one tcnt input clock cycle greater than the cycle register value, and the actual cycle corresponding to the duty register value is one tcnt input clock cycle greater than the duty register value. this
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 301 of 818 rej09b0273-0500 phenomenon is due to the fact that the value is h'0000 when the free-running counter (tcnt3 to tcnt5) is cleared. the timing in this case is shown in figure 10.25. in this example, h'0005 is set as the cycle register value and h'0000 as the duty register value, the actual cycle value is h'0006, and the actual duty value is h'0001. 0000 0001 0002 0003 0004 0005 0000 0001 0002 0003 0004 0005 0000 0001 0002 0003 actual cycle actual duty tcnt tcnt input clock compare-match signal (duty) compare-match signal (cycle) counter clear signal pwm output figure 10.25 channel 3 to 5 pwm output waveform and counter operation 10.3.14 channel 3 to 5 pwm output waveform settings and interrupt handling times since channels 3 to 5 have no function for rewriting a general register (gr) simultaneously with compare-match occurrence (buffer function) in pwm mode or when the counter clear function is set, it may not be possible to generate waveform output with a resolution that exceeds the time required to rewrite gr after a compare-match.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 302 of 818 rej09b0273-0500 the timing in this case is shown in figure 10.26. in this example, channel 5 is set to pwm mode, h'00fe is set in gr5a and h'00ff in gr5b, and free-running counter 5 (tcnt5) is started. when h'0000 (0% duty) is set in gr5a in the interrupt handling routine after a compare-match with gr5b, a 0% duty waveform cannot be output immediately since the tcnt5 value is already h'0002, and so 1 continues to be output until the subsequent compare-match with gr5a. 00fa 00fb 00fc 00fd 00fe 00ff 0000 0001 0002 00fe 00ff 0000 0001 0002 0003 period during which pwm output is 1 although duty value is 0 tcnt5 gr5a gr5b 00ff 00ff 0000 tcnt input clock compare-match signal counter clear signal interrupt status flag gr5a write signal generated in interrupt handling routine pwm output time from compare-match to gr5a rewrite figure 10.26 channel 5 waveform when duty changes from 100% to 0%
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 303 of 818 rej09b0273-0500 10.3.15 pwm output operation at start of channel 3 to 5 counter in channel 3 to 5 pwm mode, free-running counter (tcnt3 to tcnt5) pwm output is not 1 in the first cycle when the counter is started. however, the interrupt status flag is set to 1 when there is a match with the duty register value in the first cycle. the timing in this case is shown in figure 10.27. in this example, h'0003 is set as the duty register value, and h'0005 as the cycle register value. 0000 0001 0002 0003 0004 0005 0000 0001 0002 0003 0004 0005 0000 0001 0002 0003 cycle 2nd cycle 1st cycle 3rd cycle tcnt tcnt input clock counter start signal interrupt status flag pwm output duty figure 10.27 channel 3 to 5 pwm output waveform
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 304 of 818 rej09b0273-0500 10.3.16 pwm output operation at start of channel 6 to 9 counter in channels 6 to 9, the maximum tcnt input clock error occurs between the cycle register value or duty register value and the actual output waveform in the waveform of the first cycle when the free-running counter starts (there is no error in the waveform in the second and subsequent cycles). this is because the counter start signal from the cpu cannot be determined in synchronization with the tcnt input clock timing. to output a waveform with no error in the waveform of the first cycle, the initial value of the duty register (dtr) should be set to h'0000 (in this case, however, the interrupt status flag will be set when 1 is first output). the timing in this case is shown in figure 10.28. in this example, h'0003 is set as the duty register value, and h'0005 as the cycle register value. 0001 0002 0003 0004 0005 0001 0002 0003 0004 0005 0001 0002 0003 0004 cycle 2nd cycle 1st cycle error with respect to counter start 3rd cycle tcnt tcnt input clock counter start signal pwm output interrupt status flag duty figure 10.28 channel 6 to 9 pwm output waveform
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 305 of 818 rej09b0273-0500 10.3.17 timing of buffer register (bfr) write and transfer by buffer function in channels 6 to 9, if the bfr value is transferred to the duty register (dtr) by a compare-match with the cycle register (cylr) in the t2 state during a write cycle from the cpu to the buffer register (bfr), the value prior to the cpu write to bfr is transferred to dtr. the timing in this case is shown in figure 10.29. in this example, a cylr compare-match and a write of h'aaaa to bfr occur simultaneously when the bfr value is h'5555. ck t1 bfr address bfr write cycle h'aaaa h'5555 h'5555 h'aaaa written to bfr internal write signal compare-match signal address dtr bfr t2 figure 10.29 contention between buffer register (bfr) write and transfer by buffer function
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 306 of 818 rej09b0273-0500 10.4 interrupts the atu has 44 interrupt sources of five kinds: input capture interrupts, compare-match interrupts, overflow interrupts, underflow interrupts, and interval interrupts. 10.4.1 status flag setting timing imf (icf) setting timing in input capture: when an input capture signal is generated, the imf bit (icf bit in case of channel 0) is set to 1 in the timer status register (tsr), and the tcnt value is simultaneously transferred to the corresponding gr (icr in the case of channel 0). the timing in this case is shown in figure 10.30. in the example in figure 10.30, a signal is input from an external pin, and input capture is performed on detection of a rising edge. ck input capture input tcnt n gr (icr) n internal input capture signal interrupt status flag imf (icf) interrupt request signal imi (ici) t tics (input capture input setup time) figure 10.30 imf (icf) setting timing in input capture
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 307 of 818 rej09b0273-0500 imf (icf) setting timing in compare-match: the imf bit (cmf bit in case of channels 6 to 9) is set to 1 in the timer status register (tsr) by the compare-match signal generated when the general register (gr) or cycle register (cylr) value matches the timer counter (tcnt) value. the compare-match signal is generated in the last state of the match (when the matched tcnt count value is updated). the timing in this case is shown in figure 10.31. ck tcnt gr(cylr) n n n + 1 tcnt input clock compare-match signal interrupt status flag imf (cmf) interrupt request signal imi (cmi) figure 10.31 imf (cmf) setting timing in compare-match
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 308 of 818 rej09b0273-0500 ovf setting timing in overflow: when tcnt overflows (from h'ffff to h'0000, or from h'ffffffff to h'00000000), the ovf bit is set to 1 in the timer status register (tsr). the timing in this case is shown in figure 10.32. ck tcnt h'ffff h'0000 tcnt input clock overflow signal interrupt status flag ovf interrupt request signal ovi figure 10.32 ovf setting timing in overflow
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 309 of 818 rej09b0273-0500 osf setting timing in underflow: when a down-counter (dcnt) counts down from h'0001 to h'0000 on dcnt input clock input, the osf bit is set to 1 in the timer status register (tsr) when the next dcnt input clock pulse is input (when underflow occurs). however, when dcnt is h'0000, it remains unchanged at h'0000 no matter how many dcnt input clock pulses are input. the timing in this case is shown in figure 10.33. ck dcnt dcnt input clock underflow signal interrupt status flag osf interrupt request signal osi h'0001 h'0000 h'0000 figure 10.33 osf setting timing in underflow
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 310 of 818 rej09b0273-0500 timing of iif setting by interval timer: when 1 is generated by anding the rise of bit 10 ? 13 in free-running counter tcnt0l with bit itve0 ? itve3 in the interval interrupt request register (itvrr), the iif bit is set to 1 in the timer status register (tsr). the timing in this case is shown in figure 10.34. tcnt0 value n in the figure is the counter value when tcnt0l bit 10 ? 13 changes to 1. (for example, n = h'00000400 in the case of bit 10, h'00000800 in the case of bit 11, etc.) ck tcnt0 tcnt input clock internal interval signal interrupt status flag iif interrupt request signal n ? 1n figure 10.34 timing of iif setting timing by interval timer
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 311 of 818 rej09b0273-0500 10.4.2 interrupt status flag clearing clearing by cpu program: the interrupt status flag is cleared when the cpu writes 0 to the flag after reading it while set to 1. the procedure and timing in this case are shown in figure 10.35. start read 1 from tsr write 0 to tsr interrupt status flag cleared ck tsr address internal write signal address interrupt status flag imf, icf, cmf, ovf, osf, iif interrupt request signal tsr write cycle t1 t2 figure 10.35 procedure and timing for clearing by cpu program
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 312 of 818 rej09b0273-0500 clearing by dmac: the interrupt status flag (icf0b, cmf6) is cleared automatically during data transfer when the dmac is activated by input capture (icr0b) or compare-match (cylr6). the procedure and timing in this case are shown in figure 10.36. start interrupt status flag cleared during data transfer ck clear request signal from dmac interrupt status flag icf0b, cmf6 interrupt status flag clear signal interrupt request signal activate dmac figure 10.36 procedure and timing for clearing by dmac
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 313 of 818 rej09b0273-0500 10.5 cpu interface 10.5.1 registers requiring 32-bit access free-running counter 0 (tcnt0) and input capture registers 0a to 0d (icr0a to icr0d) are 32- bit registers. as these registers are connected to the cpu via an internal 16-bit data bus, a read or write (read only, in the case of icr0a to icr0d) is automatically divided into two 16-bit accesses. figure 10.37 shows a read from tcnt0, and figure 10.38 a write to tcnt0. when reading tcnt0, in the first read the tcnt0h (upper 16-bit) value is output to the internal data bus, and at the same time, the tcnt0l (lower 16-bit) value is output to an internal buffer register. then, in the second read, the tcnt0l (lower 16-bit) value held in the internal buffer register is output to the internal data bus. when writing to tcnt0, in the first write the upper 16 bits are output to an internal buffer register. then, in the second write, the lower 16 bits are output to tcnt0l, and at the same time, the upper 16 bits held in the internal buffer register are output to tcnt0h to complete the write. the above method performs simultaneous reading and simultaneous writing of 32-bit data, preventing contention with an up-count. 1st read operation 2nd read operation cpu cpu internal data bus hh internal data bus l l l bus interface internal buffer register tcnt0h tcnt0l tcnt0h tcnt0l module data bus bus interface internal buffer register module data bus module data bus figure 10.37 read from tcnt0
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 314 of 818 rej09b0273-0500 1st write operation 2nd write operation cpu internal data bus h h lh bus interface internal buffer register tcnt0h tcnt0l tcnt0h tcnt0l module data bus cpu internal data bus l bus interface internal buffer register module data bus module data bus figure 10.38 write to tcnt0 10.5.2 registers requiring 16-bit access free-running counters 1 to 9 (tcnt1 to tcnt9), the general registers (gr), down-counters (dcnt), offset base register (osbr), cycle registers (cylr), buffer registers (bfr), duty registers (dtr), and timer start register (tstr) are 16-bit registers. these registers are connected to the cpu via an internal 16-bit data bus, and can be read or written (read only, in the case of osbr) a word at a time. figure 10.39 shows the operation when performing a word read or write access to tcnt1. cpu internal data bus tcnt1 module data bus bus interface figure 10.39 tcnt1 read/write operation
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 315 of 818 rej09b0273-0500 10.5.3 8-bit or 16-bit accessible registers the timer control register (tcr), timer i/o control registers 1 to 5 (tior1 to tior5), and the timer connection register (tcnr) are 8-bit registers. these registers are connected to the upper 8 bits or lower 8 bits of the internal 16-bit data bus, and can be read or written a byte at a time. in addition, a pair of 8-bit registers for which only the least significant bit of the address is different, such as timer i/o control register 4a (tior4a) and timer i/o control register 4b (tior4b), can be read or written in combination a word at a time. figures 10.40 and 10.41 show the operation when performing individual byte read or write accesses to tior4a and tior4b. figure 10.42 shows the operation when performing a word read or write access to tior4a and tior4b simultaneously. cpu internal data bus only upper 8 bits used only upper 8 bits used tior4a tior4b module data bus bus interface figure 10.40 byte read/write access to tior4a cpu internal data bus only lower 8 bits used only lower 8 bits used tior4a tior4b module data bus bus interface figure 10.41 byte read/write access to tior4b cpu internal data bus tior4a tior4b module data bus bus interface figure 10.42 word read/write access to tior4a and tior4b
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 316 of 818 rej09b0273-0500 10.5.4 registers requiring 8-bit access the timer mode register (tmor), prescaler register 1 (pscr1), timer i/o control register 0 (tior0), the trigger selection register (tgsr), interval interrupt request register (itvrr), timer status register (tsr), timer interrupt enable register (tier), and down-count start register (dstr) are 8-bit registers. these registers are connected to the upper 8 bits or lower 8 bits of the internal 16-bit data bus, and can be read or written a byte at a time. figures 10.43 and 10.44 show the operation when performing individual byte read or write accesses to tgsr and tior0a. cpu internal data bus only upper 8 bits used only upper 8 bits used tgsr module data bus bus interface figure 10.43 byte read/write access to tgsr cpu internal data bus only lower 8 bits used only lower 8 bits used tior0a module data bus bus interface figure 10.44 byte read/write access to tiora 10.6 sample setup procedures sample setup procedures for activating the various atu functions are shown below. sample setup procedure for input capture: an example of the setup procedure for input capture is shown in figure 10.45. 1. set the first-stage counter clock
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 317 of 818 rej09b0273-0500 4. set the corresponding bit to 1 in the timer start register (tstr) to start the free-running counter (tcnt) for the relevant channel. note: when channel 0 input capture (icr0a) occurs, the tcnt1 value is always transferred to the offset base register (osbr), irrespective of channel 1 free-running counter (tcnt1) activation. for details, see section 10.3.8, twin-capture function. select counter clock 1 set port-atu connection 2 set input waveform edge detection 3 start counter 4 input capture operation start figure 10.45 sample setup procedure for input capture
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 318 of 818 rej09b0273-0500 sample setup procedure for waveform output by output compare-match: an example of the setup procedure for waveform output by output compare-match is shown in figure 10.46. 1. set the first-stage counter clock
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 319 of 818 rej09b0273-0500 select counter clock 1 set port-atu connection 2 select waveform output mode 3 set output timing 4 start counter 5 waveform output start figure 10.46 sample setup procedure for waveform output by output compare-match
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 320 of 818 rej09b0273-0500 sample setup procedure for atu channel 0 input capture triggered by channel 1 compare-match: an example of the setup procedure for atu channel 0 input capture triggered by channel 1 compare-match is shown in figure 10.47. 1. set the channel 1 timer i/o control register (tior1a) to output compare-match, and set the timing for compare-match generation in the channel 1 general register (gr1a). 2. set bits trg1a and trg1d to 1 in the trigger selection register (tgsr). 3. set the corresponding bit to 1 in the timer start register (tstr) to start the channel 1 free- running counter (tcnt1). on compare-match between tcnt1 and gr1a, the compare- match signal is transmitted to channel 0 as the channel 0 tia0 and tid0 input capture signal. set compare-match 1 set tgsr 2 start counter 3 signal transmission start figure 10.47 sample setup procedure for compare-match signal transmission
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 321 of 818 rej09b0273-0500 sample setup procedure for one-shot pulse output: an example of the setup procedure for one-shot pulse output is shown in figure 10.48. 1. set the first-stage counter clock select counter clock 1 set port-atu connection 2 set pulse width 3 start down-count 4 one-shot pulse output start figure 10.48 sample setup procedure for one-shot pulse output
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 322 of 818 rej09b0273-0500 sample setup procedure for offset one-shot pulse output: an example of the setup procedure for offset one-shot pulse output is shown in figure 10.49. 1. set the first-stage counter clock ? gr1f, gr2a, gr2b) connected to the down-counter (dcnt) corresponding to the port set in (2). 5. set the cn10a ? cn10h bit in the timer connection register (tcnr) corresponding to the port set in (2) to 1. 6. set the corresponding bit to 1 in the timer start register (tstr) to start the channel 1 or 2 free- running counter (tcnt1, tcnt2). when the tcnt value and gr value match, the corresponding dcnt starts counting down, and one-shot pulse output is performed.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 323 of 818 rej09b0273-0500 select counter clock 1 set port-atu connection 2 set pulse width 3 set offset width 4 set offset operation 5 start count 6 offset one-shot pulse output start figure 10.49 sample setup procedure for offset one-shot pulse output
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 324 of 818 rej09b0273-0500 sample setup procedure for interval timer operation: an example of the setup procedure for interval timer operation is shown in figure 10.50. 1. set the first-stage counter clock ? itve3 bit to be used in the interval interrupt request register (itvrr) to 1. an interrupt request can be sent to the cpu when the corresponding bit changes to 1 in the channel 0 free-running counter (tcnt0). to start a/d converter sampling, set the itvad0 ? itvad3 bit to be used in itvrr to 1. 3. set bit 0 to 1 in the timer start register (tstr) to start tcnt0. note: tcnt0 bit 10 corresponds to itve0 and itvad0, bit 11 to itve1 and itvad1, bit 12 to itve2 and itvad2, and bit 13 to itve3 and itvad3. select counter clock 1 set interval 2 start counter 3 interrupt request to cpu or start of a/d0 sampling start figure 10.50 sample setup procedure for interval timer operation
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 325 of 818 rej09b0273-0500 sample setup procedure for pwm timer operation (channels 3 to 5 ): an example of the setup procedure for pwm timer operation (channels 3 to 5 ) is shown in figure 10.51. 1. set the first-stage counter clock ? t5pwm in the timer mode register (tmdr) to pwm mode. when pwm mode is set, the tiod3. tiod4, and tiod5 pins go to 0 output irrespective of the timer i/o control register (tior) contents. 4. the gr3a ? gr3c, gr4a ? gr4c, and gr5a atu general registers are used as duty registers (dtr), and the gr3d, gr4d, and gr5b atu general registers as cycle registers (cylr). set the pwm waveform output 0 output timing in dtr, and the pwm waveform output 1 output timing in cylr. 5. set the corresponding bit to 1 in the timer start register (tstr) to start the free-running counter (tcnt) for the relevant channel.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 326 of 818 rej09b0273-0500 select counter clock 1 set port-atu connection 2 set pwm timer 3 set gr 4 start count 5 pwm waveform output start figure 10.51 sample setup procedure for pwm timer operation (channels 3 to 5)
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 327 of 818 rej09b0273-0500 sample setup procedure for pwm timer operation (channels 6 to 9): an example of the setup procedure for pwm timer operation (channels 6 to 9 ) is shown in figure 10.52. 1. set the first-stage counter clock ? tcr9). 2. set the port b control register (pbcr) corres ponding to the waveform output port to atu pwm output. also set the corresponding bit to 1 in the port b io register (pbior) to specify the output attribute. 3. set pwm waveform output 1 output timing in the cycle register (cylr6 ? cylr9), and set the pwm waveform output 0 output timing in the buffer register (bfr6 ? bfr9) and duty register (dtr6 ? dtr9). if necessary, an interrupt request can be sent to the cpu on a compare-match between the cylr value and the free-running counter (tcnt) value by making the appropriate setting in the interrupt enable register (tiere). 4. set the corresponding bit to 1 in the timer start register (tstr) to start the tcnt counter for the relevant channel. notes: 1. do not make a setting in dtr after the counter is started. use bfr to make a dtr setting. for details, see section 10.3.10, buffer function. 2. 0% duty is specified by setting h'0000 in the duty register (dtr), and 100% duty is specified by setting buffer register (bfr)
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 328 of 818 rej09b0273-0500 select counter clock 1 set port-atu connection 2 set cylr, bfr, dtr 3 start count 4 pwm waveform output start figure 10.52 sample setup procedure for pwm timer operation (channels 6 to 9)
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 329 of 818 rej09b0273-0500 10.7 usage notes note that the kinds of operation and contention described below occur during atu operation. contention between tcnt write and clearing by compare-match: with channel 3 to 9 free- running counters (tcnt3 to tcnt9), if a compare-match occurs in the t2 state of a cpu write cycle when clearing is enabled, the write to tcnt has priority and clearing is not performed. the compare-match remains valid, and writing of 1 to the interrupt status flag and waveform output to an external destination are performed in the same way as for a normal compare-match. the timing in this case is shown in figure 10.53. ck t1 address tcnt address cpu write value internal write signal compare-match signal counter clear signal tcnt interrupt status flag external output signal (1 output) t2 figure 10.53 contention between tcnt write and clear
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 330 of 818 rej09b0273-0500 contention between gr write and data transfer by input capture: if input capture occurs in the t2 state of a cpu write cycle for a channel 1 to 5 general register (gr1a to gr1f, gr2a, gr2b, gr3a to gr3d, gr4a to gr4d, gr5a, gr5b), the write to tcnt has priority and the data transfer to gr is not performed. writing of 1 to the interrupt status flag due to input capture is performed in the same way as for normal input capture. the timing in this case is shown in figure 10.54. ck t1 address gr address cpu write value internal write signal internal input capture signal gr interrupt status flag t2 figure 10.54 contention between gr write and data transfer by input capture
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 331 of 818 rej09b0273-0500 contention between tcnt write and increment: if a write to a channel 0 to 9 free-running counter (tcnt0 to tcnt9) is performed while that counter is counting up, the write to the counter has priority and the counter is not incremented. the timing in this case is shown in figure 10.55. in this example, the cpu writes h'5555 at the point at which tcnt is to be incremented from h'1001 to h'1002. ck t1 tcnt address 5555 (cpu write value) internal write signal tcnt input clock address tcnt t2 1001 5556 figure 10.55 contention between tcnt write and increment
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 332 of 818 rej09b0273-0500 contention between tcnt write and counter clearing by overflow: with channel 3 to 5 free-running counters (tcnt3 to tcnt5), if overflow occurs in the t2 state of a cpu write cycle when clearing is enabled, the write to tcnt has priority and the counter is not cleared to h'0000. writing of 1 to the interrupt status flag (ovf) due to the overflow is performed in the same way as for normal overflow. the timing in this case is shown in figure 10.56. in this example, h'5555 is written at the point at which tcnt overflows. ck t1 tcnt address 5555 (cpu write value) internal write signal overflow signal interrupt status flag (ovf) tcnt input clock address tcnt t2 ffff 5556 figure 10.56 contention between tcnt write and overflow
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 333 of 818 rej09b0273-0500 contention between interrupt status flag setting by interrupt generation and clearing: if an event such as input capture/compare-match or overflow/underflow occurs in the t2 state of an interrupt status flag 0 write cycle by the cpu, setting of the interrupt status flag to 1 by that event has priority and the interrupt status flag is not cleared. the timing in this case is shown in figure 10.57. ck t1 tsr address n + 1 n 0 written to tsr n remains unchanged at 1 internal write signal compare-match signal interrupt status flag imf address tcnt gr t2 tsr write cycle figure 10.57 contention between interrupt status flag setting by compare-match and clearing
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 334 of 818 rej09b0273-0500 contention between dtr write and bfr value transfer by buffer function: do not write to the duty register (dtr) when the free-running counter (tcnt) has been started in channels 6 to 9. if there is contention between transfer of the buffer register (bfr) value to the corresponding dtr due to a cycle register compare-match, and a write to dtr by the cpu, the or of the bfr value and cpu write value is written to dtr. figure 10.58 shows an example in which contention arises when the bfr value is h'aaaa and the value to be written to dtr is h'5555. ck dtr address h'5555 written to dtr h'aaaa h'ffff (or of h'5555 and h'aaaa) internal write signal compare-match signal address dtr bfr figure 10.58 contention between dtr write and bfr value transfer by buffer function
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 335 of 818 rej09b0273-0500 contention between interrupt status flag clearing by dmac and setting by input capture/compare-match: if a clear request signal is generated by the dmac when the interrupt status flag (icf0b, cmf6) is set by input capture (icr0b) or compare-match (cylr6), clearing by the dmac has priority and the interrupt status flag is not set. the width of the dmac clear request signal is normally two states, the same as an atu access cycle, and clearing is performed in two states. if a bus wait, or a bus request from off-chip, occurs while the dmac clear request signal is being output, the dmac clear request signal width will be n states (n ck a. when the input capture/compare-match signal precedes the interrupt status flag clear signal by 1/2 state dmac clear request signal 1/2 state input capture/ compare-match signal interrupt status flag icf0b, cmf6 interrupt status flag clear signal ck dmac clear request signal input capture/ compare-match signal interrupt status flag icf0b, cmf6 interrupt status flag clear signal b. when the input capture/compare-match signal follows the interrupt status flag clear signal by 1/2 state, and contention arises figure 10.59 contention between interrupt status flag clearing by dmac and setting by input capture/compare-match
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 336 of 818 rej09b0273-0500 halting of a down-counter by the cpu: a down-counter (dcnt) can be halted by writing h'0000 to it. the cpu cannot write 0 directly to the down-count start register (dstr); instead, by setting dcnt to h'0000, the corresponding dstr bit is cleared to 0 and the count is stopped. however, the osf bit in the timer status register (tsr) is set when dcnt underflows. note that when h'0000 is written to dcnt, the corresponding dstr bit is not cleared to 0 immediately; it is cleared to 0, and the down-counter is stopped, when underflow occurs following the h'0000 write. the timing in this case is shown in figure 10.60 ck h'0000 written to dcnt h'0000 h'0000 n internal write signal dcnt dcnt input clock port output (one-shot pulse) tsr dstr figure 10.60 halting of a down-counter by the cpu
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 337 of 818 rej09b0273-0500 starting a count with a down-counter value of h'0000: a one-shot pulse will not be output if the down-count start register (dstr) is set and the down-counter (dcnt) count started from the cpu, or the timer connection register (tcnr) is set and dcnt is started by a channel 1 or channel 2 compare-match, when the dcnt value is h'0000. however, the osf bit in the timer status register (tsr) will be set to 1. the timing in this case is shown in figure 10.61 ck 1 written to dst bit in dstr h'0000 h'0000 remains unchanged at 0 internal write signal dcnt dcnt input clock port output (one-shot pulse) tsr dstr figure 10.61 starting a count with a down-counter value of h'0000
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 338 of 818 rej09b0273-0500 input capture operation when free-running counter is halted: in channel 0 or channels 1 to 5, if input capture setting is performed and a trigger signal is input from the input pin, the tcnt value will be transferred to the corresponding general register (gr) or input capture register (icr) irrespective of whether the free-running counter (tcnt) is running or halted, and the imf or icf bit will be set in the timer status register (tsr). the timing in this case is shown in figure 10.62 ck n internal input capture signal interrupt status flag imf (icf) timer status register tsr tcnt gr (icr) n figure 10.62 input capture operation before free-running counter is started
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 339 of 818 rej09b0273-0500 contention between dcnt write and counter clearing by underflow: with the channel 10 down-counters (dcnt10a to dcnt10h), if the count is halted due to underflow occurring in the t2 state of a down-counter write cycle by the cpu, retention of the h'0000 value has priority and the write to dcnt by the cpu is not performed. writing of 1 to the interrupt status flag (osf) when the underflow occurs is performed in the same way as for normal underflow. the timing in this case is shown in figure 10.63. in this example, a write of h'5555 to dcnt is attempted at the same time as dcnt underflows. ck t1 dcnt address internal write signal dcnt input clock underflow signal address 5555 write data dcnt interrupt status flag (osf) t2 0000 0000 0001 h'0000 retained when dcnt halts figure 10.63 contention between dcnt write and underflow
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 340 of 818 rej09b0273-0500 contention between dstr bit setting by cpu and clearing by underflow: if underflow occurs in the t2 state of a down-counter start register (dstr) ? 1 ? write cycle by the cpu, clearing to 0 by the underflow has priority, and the corresponding bit of dstr is not set to 1. the timing in this case is shown in figure 10.64. ck t1 dstr address str write cycle 1 written to dstr internal write signal underflow signal address down-count start register t2 dcnt 0000 0000 0001 figure 10.64 contention between dstr bit setting by cpu and clearing by underflow
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 341 of 818 rej09b0273-0500 timing of prescaler register (pscr1), timer control register (tcr), and timer mode register (tmdr) setting: settings in the prescaler register (pscr1), timer control register (tcr), and timer mode register (tmdr) should be made before the counter is started. operation is not guaranteed if these registers are modified while the counter is running. interrupt status flag clearing procedure: when an interrupt status flag is cleared to 0 by the cpu, it must first be read before 0 is written to it. correct operation cannot be guaranteed if 0 is written without first reading the flag. setting h'0000 in free-running counters 6 to 9 (tcnt6 to tcnt9): if h'0000 is written to a channel 6 to 9 free-running counter (tcnt6 to tcnt9), and the counter is started, the interval up to the first compare-match with the cycle register (cylr) and duty register (dtr) will be a maximum of one tcnt input clock cycle longer than the set value. with subsequent compare- matches, the correct waveform will be output for the cylr and dtr values. register values when a free-running counter (tcnt) halts: if the timer start register (tstr) value is set to 0 during counter operation, only incrementing of the corresponding free- running counter (tcnt) is stopped, and neither the free-running counter (tcnt) nor any other atu registers are initialized. the external output value at the time tstr is cleared to 0 will continue to be output. tcnt0 writing and interval timer operation: if the cpu program writes 1 to a bit in free- running counter 0 (tcnt0) corresponding to a bit set to 1 in the interval interrupt request register (itvrr) when that tcnt0 bit is 0, tcnt0 bit 10, 11, 12, or 13 will be detected as having changed from 0 to 1, and an interrupt request will be sent to intc and a/d sampling will be started. automatic tsr clearing by dmac activation by the atu: when the dmac is activated by the atu, automatic clearing of tsr will not be performed unless an address in the atu ? s i/o space (h'ffff8200 to h'ffff82ff) is set as either the dmac data transfer source address or destination address. if it is wished to set an address outside the atu ? s i/o space for both transfer source and destination, the corresponding bit should be written with 0 after being read while set to 1 from within the interrupt handling routine. interrupt status flag setting/resetting: with tsrf, a 0 write to a bit is invalid only if duplicate events have occurred for the same bit before writing 0 after reading 1 to clear a specific bit. (the duplicate events are accepted.) in order to perform the 0 write, another 1 read is necessary. also, with tsra to tsre, events are not accepted even if duplicate events have occurred for the same bit before a 0 write following a 1 read is performed.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 342 of 818 rej09b0273-0500 external output value in software standby mode: in software standby mode, the atu register and external output values are cleared to 0. however, while the tioa to tiof1, tioa, and tiob2 external output values are cleared to 0 immediately after software standby mode is exited, other external output values and all registers are cleared to 0 immediately before a transition to software standby mode. ck software standby mode other external outputs tioa ? f1, tioa, b2 figure 10.65 external output value transition points in relation to software standby mode
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 343 of 818 rej09b0273-0500 10.8 advanced timer unit registers and pins table 10.4 atu registers and pins channel register name channel 0 channel 1 channel 2 channel 3 channel 4 channel 5 channel 6 channel 7 channel 8 channel 9 channel 10 tstr (16) tstr tstr tstr tstr tstr tstr tstr tstr tstr tstr ? tmdr (8) ??? tmdr tmdr tmdr ????? tcr (8) ? tcr1 tcr2 tcr3 tcr4 tcr5 tcr6 tcr7 tcr8 tcr9 tcr10 pscr1 (8) pscr1 pscr1 pscr1 pscr1 pscr1 pscr1 pscr1 pscr1 pscr1 pscr1 pscr1 tior (8) tior0a tior1a to tior1c tior2a tior3a tior3b tior4a tior4b tior5a ????? tgsr (8) tgsr ?????????? tsr (8) tsrah, tsral tsrb tsrc tsrdh tsrdl tsrdh tsrdl tsrdh tsrdl tsre tsre tsre tsre tsrf tier (8) tiera tierb tierc tierdh tierdl tierdh tierdl tierdh tierdl tiere tiere tiere tiere tierf itvrr (8) itvrr ?????????? dstr (8) ?????????? dstr tcndr (8) ?????????? tcnr tcnt (16) tcnt0h, tcnt0l tcnt1 tcnt2 tcnt3 tcnt4 tcnt5 tcnt6 tcnt7 tcnt8 tcnt9 ? icr (16) icr0ah, icr0al to icr0dh, icr0dl ?????????? gr (16) ? gr1a to gr1f gr2a gr2b gr3a to gr3d gr4a to gr4d gr5a gr5b ????? dcnt (16) ?????????? dcnt10a to dcnt10 h osbr (16) ? osbr ????????? cylr (16) ?????? cylr6 cylr7 cylr8 cylr9 ? bfr (16) ?????? bfr6 bfr7 bfr8 bfr9 ? dtr (16) ?????? dtr6 dtr7 dtr8 dtr9 ? pins * tia0 to tid0 tioa1 to tiof1, tclka, tclkb tioa2 tiob2 tclka tclkb tioa3 to tiod3 tclka tclkb tioa4 to tiod4 tclka tclkb tioa5 tiob5 tclka tclkb to6to7to8to9toa10 to toh10 note: * pin functions should be set as described in section 16, pin function controller (pfc). the function of dual input/output pins (e.g. tioa1) can also be set as described in section 17, i/o ports.
section 10 advanced timer unit (atu) rev. 5.00 jan 06, 2006 page 344 of 818 rej09b0273-0500
section 11 advanced pulse controller (apc) rev. 5.00 jan 06, 2006 page 345 of 818 rej09b0273-0500 section 11 advanced pulse controller (apc) 11.1 overview the sh7050 series has an on-chip advanced pulse controller (apc) that can generate a maximum of eight pulse outputs, using the advanced timer unit (atu) as the time base. 11.1.1 features the features of the apc are summarized below. ? maximum eight pulse outputs the pulse output pins can be selected from among eight pins. multiple settings are possible. ? output trigger provided by advanced timer unit (atu) channel 2 pulse 0 output and 1 output is performed using the compare-match signal generated by the atu channel 2 compare-match register as the trigger.
section 11 advanced pulse controller (apc) rev. 5.00 jan 06, 2006 page 346 of 818 rej09b0273-0500 11.1.2 block diagram figure 11.1 shows a block diagram of the advanced pulse controller. internal/external clock compare compare- match signal atu popcr (pulse output port setting register) apc tcnt2 gr2a gr2b reset set reset set reset set reset set reset set reset set reset set reset set puls0 puls1 puls2 puls3 puls5 puls4 puls6 puls7 legend: popcr: pulse output port control register bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 compare- match signal figure 11.1 advanced pulse controller block diagram
section 11 advanced pulse controller (apc) rev. 5.00 jan 06, 2006 page 347 of 818 rej09b0273-0500 11.1.3 pin configuration table 11.1 summarizes the advanced pulse controller?s output pins. table 11.1 advanced pulse controller pins pin name i/o function puls0 output apc pulse output 0 puls1 output apc pulse output 1 puls2 output apc pulse output 2 puls3 output apc pulse output 3 puls4 output apc pulse output 4 puls5 output apc pulse output 5 puls6 output apc pulse output 6 puls7 output apc pulse output 7 11.1.4 register configuration table 11.2 summarizes the advanced pulse controller?s register. table 11.2 advanced pulse controller register name abbreviation r/w initial value address access size pulse output port control register popcr r/w h'0000 h'ffff83c0 8, 16 note: register access requires 2 cycles.
section 11 advanced pulse controller (apc) rev. 5.00 jan 06, 2006 page 348 of 818 rej09b0273-0500 11.2 register descriptions 11.2.1 pulse output port control register (popcr) the pulse output port control register (popcr) is a 16-bit readable/writable register. popcr is initialized to h'0000 by a power-on reset and in hardware standby mode. it is not initialized in software standby mode. bit:1514131211109876543210 puls7 roe puls6 roe puls5 roe puls4 roe puls3 roe puls2 roe puls1 roe puls0 roe puls7 soe puls6 soe puls5 soe puls4 soe puls3 soe puls2 soe puls1 soe puls0 soe initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bits 15 to 8?puls7 to puls0 reset output enable (puls7roe to puls0roe): these bits enable or disable 0 output to the apc pulse output pins (puls7 to puls0) bit by bit. bits 15 to 8: puls7 to 0roe description 0 0 output to apc pulse output pin (puls7?puls0) is disabled (initial value) 1 0 output to apc pulse output pin (puls7?puls0) is enabled when one of these bits is set to 1, 0 is output from the corresponding pin on a compare-match between the gr2b and tcnt2 values. bits 7 to 0?puls7 to puls0 set output enable (puls7soe to puls0soe): these bits enable or disable 1 output to the apc pulse output pins (puls7 to puls0) bit by bit. bits 7 to 0: puls7 to 0soe description 0 1 output to apc pulse output pin (puls7?puls0) is disabled (initial value) 1 1 output to apc pulse output pin (puls7?puls0) is enabled when one of these bits is set to 1, 1 is output from the corresponding pin on a compare-match between the gr2a and tcnt2 values.
section 11 advanced pulse controller (apc) rev. 5.00 jan 06, 2006 page 349 of 818 rej09b0273-0500 11.3 operation 11.3.1 overview apc pulse output is enabled by designating multiplex pins for apc pulse output with the pin function controller (pfc), and setting the corresponding bits to 1 in the pulse output port control register (popcr). when general register 2a (gr2a) in the advanced timer unit (atu) subsequently generates a compare-match signal, 1 is output from the pins set to 1 by bits 7 to 0 in popcr. when general register 2b (gr2b) generates a compare-match signal, 0 is output from the pins set to 1 by bits 15 to 8 in popcr. 0 is output from the output-enabled state until the first compare-match occurs. the advanced pulse controller output operation is shown in figure 11.2. cr port function selection upper 8 bits of popcr lower 8 bits of popcr reset signal set signal apc output pins (puls0 to puls7) compare-match signal compare-match signal gr2b gr2a figure 11.2 advanced pulse controller output operation
section 11 advanced pulse controller (apc) rev. 5.00 jan 06, 2006 page 350 of 818 rej09b0273-0500 11.3.2 advanced pulse controller output operation example of setting procedure for advanced pulse controller output operation: figure 11.3 shows an example of the setting procedure for advanced pulse controller output operation. 1. set general registers gr2a and gr2b as output compare registers with the timer i/o control register (tior). 2. set the pulse rise point with gr2a and the pulse fall point with gr2b. 3. select the timer counter 2 (tcnt2) counter clock with the timer prescale register (pscr). tcnt2 can only be cleared by an overflow. 4. enable the respective interrupts with the timer interrupt enable register (tier). 5. set the pins for 1 output and 0 output with popcr. 6. set the control register for the port to be used by the apc to the apc output pin function. 7. set the str bit to 1 in the timer start register (tstr) to start timer counter 2 (tcnt2). 8. each time a compare-match interrupt is generated, update the gr value and set the next pulse output time. 9. each time a compare-match interrupt is generated, update the popcr value and set the next pin for pulse output.
section 11 advanced pulse controller (apc) rev. 5.00 jan 06, 2006 page 351 of 818 rej09b0273-0500 gr function selection gr setting count operation setting interrupt request setting rise/fall port setting port output setting start count gr setting rise/fall port setting apc output operation compare-match? atu settings port setting atu setting atu setting apc setting apc setting 1 2 3 4 5 6 7 8 9 no yes figure 11.3 example of setting procedure for advanced pulse controller output operation example of advanced pulse controller output operation: figure 11.4 shows an example of advanced pulse controller output operation. 1. set atu registers gr2a and gr2b (to be used for output trigger generation) as output compare registers. set the rise point in gr2a and the fall point in gr2b, and enable the respective compare-match interrupts. 2. write h'0101 to popcr. 3. start atu timer 2. when a gr2a compare-match occurs, 1 is output from the puls0 pin. when a gr2b compare-match occurs, 0 is output from the puls0 pin.
section 11 advanced pulse controller (apc) rev. 5.00 jan 06, 2006 page 352 of 818 rej09b0273-0500 4. pulse output widths and output pins can be continually changed by successively rewriting gr2a, gr2b, and popcr in response to compare-match interrupts. 5. by setting popcr to a value such as h'e0e0, pulses can be output from up to 8 pins in response to a single compare-match. gr2b gr2a h'0000 popcr puls0 puls1 puls2 puls3 puls4 puls5 puls6 puls7 tcnt value cleared on overflow e0e0 rewritten rewritten rewritten rewritten rewritten rewritten rewritten rewritten rewritten rewritten 0101 1010 0808 0404 0202 figure 11.4 example of advanced pulse controller output operation
section 11 advanced pulse controller (apc) rev. 5.00 jan 06, 2006 page 353 of 818 rej09b0273-0500 11.4 usage notes contention between compare-match signals: if the same value is set for both gr2a and gr2b, and 0 output and 1 output are both enabled for the same pin by the popcr settings, 0 output has priority on pins puls0 to puls7 when compare-matches occur. h'8000 gr2a h'8000 h'ffff h'8000 gr2b h'0101 popcr puls0 pin tcnt value pin output is 0 figure 11.5 example of compare-match contention
section 11 advanced pulse controller (apc) rev. 5.00 jan 06, 2006 page 354 of 818 rej09b0273-0500
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 355 of 818 rej09b0273-0500 section 12 watchdog timer (wdt) 12.1 overview the watchdog timer (wdt) is a 1-channel timer for monitoring system operations. if a system encounters a problem (crashes, for example) and the timer counter overflows without being rewritten correctly by the cpu, an overflow signal ( wdtovf ) is output externally. the wdt can simultaneously generate an internal reset signal for the entire chip. when the watchdog function is not needed, the wdt can be used as an interval timer. in the interval timer operation, an interval timer interrupt is generated at each counter overflow. the wdt is also used in recovering from the standby mode. 12.1.1 features ? works in watchdog timer mode or interval timer mode. ? outputs wdtovf in the watchdog timer mode. when the counter overflows in the watchdog timer mode, overflow signal wdtovf is output externally. you can select whether to reset the chip internally when this happens. either the power-on reset or manual reset signal can be selected as the internal reset signal. ? generates interrupts in the interval timer mode. when the counter overflows, it generates an interval timer interrupt. ? clears standby mode. ? works with eight counter input clocks.
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 356 of 818 rej09b0273-0500 12.1.2 block diagram figure 12.1 is the block diagram of the wdt. /2 /64 /128 /256 /512 /1024 /4096 /8192 internal clock sources clock overflow clock select interrupt control reset control rstcsr tcsr: tcnt: rstcsr: note: timer control/status register timer counter reset control/status register the internal reset signal can be generated by setting the register. the type of reset can be selected (power-on or manual). tcnt tcsr module bus bus interface internal data bus iti (interrupt signal) wdtovf internal reset signal * wdt figure 12.1 wdt block diagram 12.1.3 pin configuration table 12.1 shows the pin configuration. table 12.1 pin configuration pin abbreviation i/o function watchdog timer overflow wdtovf o outputs the counter overflow signal in the watchdog timer mode
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 357 of 818 rej09b0273-0500 12.1.4 register configuration table 12.2 summarizes the three wdt registers. they are used to select the clock, switch the wdt mode, and control the reset signal. table 12.2 wdt registers address name abbreviation r/w initial value write * 1 read * 2 timer control/status register tcsr r/(w) * 3 h'18 h'ffff8610 h'ffff8610 timer counter tcnt r/w h'00 h'ffff8611 reset control/status register rstcsr r/(w) * 3 h'1f h'ffff8612 h'ffff8613 notes: in register access, three cycles are required for both byte access and word access. 1. write by word transfer. it cannot be written in byte or longword. 2. read by byte transfer. it cannot be read in word or longword. 3. only 0 can be written in bit 7 to clear the flag. 12.2 register descriptions 12.2.1 timer counter (tcnt) the tcnt is an 8-bit read/write upcounter. (the tcnt differs from other registers in that it is more difficult to write to. see section 12.2.4, register access, for details.) when the timer enable bit (tme) in the timer control/status register (tcsr) is set to 1, the watchdog timer counter starts counting pulses of an internal clock selected by clock select bits 2 to 0 (cks2 to cks0) in the tcsr. when the value of the tcnt overflows (changes from h'ff to h'00), a watchdog timer overflow signal ( wdtovf ) or interval timer interrupt (iti) is generated, depending on the mode selected in the wt/ it bit of the tcsr. the tcnt is initialized to h'00 by a power-on reset and when the tme bit is cleared to 0. it is not initialized in the standby mode. bit:76543210 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 358 of 818 rej09b0273-0500 12.2.2 timer control/status register (tcsr) the timer control/status register (tcsr) is an 8-bit read/write register. (the tcsr differs from other registers in that it is more difficult to write to. see section 12.2.4, register access, for details.) tcsr performs selection of the timer counter (tcnt) input clock and mode. bits 7 to 5 are initialized to 000 by a power-on reset, in hardware standby mode and software standby mode. bits 2 to 0 are initialized to 000 by a power-on reset and in hardware standby mode, but retain their values in the software standby mode. bit:76543210 ovf wt/ it tme ? ? cks2 cks1 cks0 initial value:00011000 r/w: r/(w) * r/w r/w r r r/w r/w r/w note: * only 0 can be written in bit 7 to clear the flag. bit 7?overflow flag (ovf): indicates that the tcnt has overflowed from h'ff to h'00 in the interval timer mode. it is not set in the watchdog timer mode. bit 7: ovf description 0 no overflow of tcnt in interval timer mode (initial value) cleared by reading ovf, then writing 0 in ovf 1 tcnt overflow in the interval timer mode bit 6?timer mode select (wt/ it it it it ): selects whether to use the wdt as a watchdog timer or interval timer. when the tcnt overflows, the wdt either generates an interval timer interrupt (iti) or generates a wdtovf signal, depending on the mode selected. bit 6: wt/ it it it it description 0 interval timer mode: interval timer interrupt request to the cpu when tcnt overflows (initial value) 1 watchdog timer mode: wdtovf signal output externally when tcnt overflows. (section 12.2.3, reset control/status register (rstcsr), describes in detail what happens when tcnt overflows in the watchdog timer mode.)
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 359 of 818 rej09b0273-0500 bit 5?timer enable (tme): enables or disables the timer. bit 5: tme description 0 timer disabled: tcnt is initialized to h'00 and count-up stops (initial value) 1 timer enabled: tcnt starts counting. a wdtovf signal or interrupt is generated when tcnt overflows. bits 4 and 3?reserved: these bits always read as 1. the write value should always be 1. bits 2 to 0: clock select 2 to 0 (cks2 to cks0): these bits select one of eight internal clock sources for input to the tcnt. the clock signals are obtained by dividing the frequency of the system clock ( ). description bit 2: cks2 bit 1: cks1 bit 0: cks0 clock source overflow interval * ( = 20 mhz) 00 0 /2 (initial value) 25.6 s 00 1 /64 819.2 s 01 0 /128 1.6 ms 01 1 /256 3.3 ms 10 0 /512 6.6 ms 10 1 /1024 13.1 ms 11 0 /4096 52.4 ms 11 1 /8192 104.9 ms note: * the overflow interval listed is the time from when the tcnt begins counting at h'00 until an overflow occurs.
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 360 of 818 rej09b0273-0500 12.2.3 reset control/status register (rstcsr) the rstcsr is an 8-bit readable and writable register. (the rstcsr differs from other registers in that it is more difficult to write. see section 12.2.4, register access, for details.) it controls output of the internal reset signal generated by timer counter (tcnt) overflow and selects the internal reset signal type. rstcr is initialized to h'1f by input of a reset signal from the res pin, but is not initialized by the internal reset signal generated by the overflow of the wdt. it is initialized to h'1f in hardware standby mode and software standby mode. bit:76543210 wovfrste?????? initial value:00001111 r/w: r/(w) * r/wrrrrrr note: * only 0 can be written in bit 7 to clear the flag. bit 7?watchdog timer overflow flag (wovf): indicates that the tcnt has overflowed (h'ff to h'00) in the watchdog timer mode. it is not set in the interval timer mode. bit 7: wovf description 0 no tcnt overflow in watchdog timer mode (initial value) cleared when software reads wovf, then writes 0 in wovf 1 set by tcnt overflow in watchdog timer mode bit 6?reset enable (rste): selects whether to reset the chip internally if the tcnt overflows in the watchdog timer mode. bit 6: rste description 0 not reset when tcnt overflows (initial value). lsi not reset internally, but tcnt and tcsr reset within wdt. 1 reset when tcnt overflows bit 5, 4?reserved: these bits always read as 0. the write value should always be 0. bits 3 to 0?reserved: these bits always read as 1. the write value should always be 1.
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 361 of 818 rej09b0273-0500 12.2.4 register access the watchdog timer?s tcnt, tcsr, and rstcsr registers differ from other registers in that they are more difficult to write to. the procedures for writing and reading these registers are given below. writing to the tcnt and tcsr: these registers must be written by a word transfer instruction. they cannot be written by byte transfer instructions. the tcnt and tcsr both have the same write address. the write data must be contained in the lower byte of the written word. the upper byte must be h'5a (for the tcnt) or h'a5 (for the tcsr) (figure 12.2). this transfers the write data from the lower byte to the tcnt or tcsr. h'5a h'ffff8610 address: writing to the tcnt 15 8 7 0 write data h'a5 h'ffff8610 address: writing to the tcsr 15 8 7 0 write data figure 12.2 writing to the tcnt and tcsr writing to the rstcsr: the rstcsr must be written by a word access to address h'ffff8612. it cannot be written by byte transfer instructions. procedures for writing 0 in wovf (bit 7) and for writing to rste (bit 6) and rsts (bit 5) are different, as shown in figure 12.3. to write 0 in the wovf bit, the write data must be h'a5 in the upper byte and h'00 in the lower byte. this clears the wovf bit to 0. the rste and rsts bits are not affected. to write to the rste and rsts bits, the upper byte must be h'5a and the lower byte must be the write data. the values of bits 6 and 5 of the lower byte are transferred to the rste and rsts bits, respectively. the wovf bit is not affected.
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 362 of 818 rej09b0273-0500 h'a5 h'ffff8612 address: writing 0 to the wovf bit 15 8 7 0 h'00 h'5a h'ffff8612 address: writing to the rste bit 15 8 7 0 write data figure 12.3 writing to the rstcsr reading from the tcnt, tcsr, and rstcsr: tcnt, tcsr, and rstcsr are read like other registers. use byte transfer instructions. the read addresses are h'ffff8610 for the tcsr, h'ffff8611 for the tcnt, and h'ffff8613 for the rstcsr. 12.3 operation 12.3.1 watchdog timer mode to use the wdt as a watchdog timer, set the wt/ it and tme bits of the tcsr to 1. software must prevent tcnt overflow by rewriting the tcnt value (normally by writing h'00) before overflow occurs. no tcnt overflows will occur while the system is operating normally, but if the tcnt fails to be rewritten and overflows occur due to a system crash or the like, a wdtovf signal is output externally (figure 12.4). the wdtovf signal can be used to reset the system. the wdtovf signal is output for 128 clock cycles. if the rste bit in the rstcsr is set to 1, a signal to reset the chip will be generated internally simultaneous to the wdtovf signal when tcnt overflows. either a power-on reset or a manual reset can be selected by the rsts bit. the internal reset signal is output for 512 clock cycles. when a watchdog overflow reset is generated simultaneously with a reset input at the res pin, the res reset takes priority, and the wovf bit is cleared to 0. the following are not initialized a wdt reset signal: ? pfc (pin function controller) function register ? i/o port register initializing is only possible by external power-on reset.
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 363 of 818 rej09b0273-0500 h'ff h'00 overflow wt/ it = 1 tme = 1 h'00 written in tcnt internal reset signal * wdtovf signal tcnt value wdtovf and internal reset generated wovf = 1 wt/ it = 1 tme = 1 wt/ it : tme: timer mode select bit timer enable bit h'00 written in tcnt time 512 figure 12.4 operation in the watchdog timer mode
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 364 of 818 rej09b0273-0500 12.3.2 interval timer mode to use the wdt as an interval timer, clear wt/ it to 0 and set tme to 1. an interval timer interrupt (iti) is generated each time the timer counter overflows. this function can be used to generate interval timer interrupts at regular intervals (figure 12.5). h'ff tcnt value iti: interval timer interrupt request generation h'00 wt/it = 0 tme = 1 iti iti iti iti time overflow overflow overflow overflow figure 12.5 operation in the interval timer mode 12.3.3 clearing the standby mode the watchdog timer has a special function to clear the standby mode with an nmi interrupt. when using the standby mode, set the wdt as described below. before transition to the standby mode: the tme bit in the tcsr must be cleared to 0 to stop the watchdog timer counter before it enters the standby mode. the chip cannot enter the standby mode while the tme bit is set to 1. set bits cks2 to cks0 so that the counter overflow interval is equal to or longer than the oscillation settling time. see section 22.3, ac characteristics, for the oscillation settling time. recovery from the standby mode: when an nmi request signal is received in standby mode, the clock oscillator starts running and the watchdog timer starts incrementing at the rate selected by bits cks2 to cks0 before the standby mode was entered. when the tcnt overflows (changes from h'ff to h'00), the clock is presumed to be stable and usable; clock signals are supplied to the entire chip and the standby mode ends. for details on the standby mode, see section 21, power-down states.
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 365 of 818 rej09b0273-0500 12.3.4 timing of setting the overflow flag (ovf) in the interval timer mode, when the tcnt overflows, the ovf flag of the tcsr is set to 1 and an interval timer interrupt is simultaneously requested (figure 12.6). h'ff h'00 ck tcnt overflow signal (internal signal) ovf figure 12.6 timing of setting the ovf 12.3.5 timing of setting the watchdog timer overflow flag (wovf) when the tcnt overflows in the watchdog timer mode, the wovf bit of the rstcsr is set to 1 and a wdtovf signal is output. when the rste bit is set to 1, tcnt overflow enables an internal reset signal to be generated for the entire chip (figure 12.7). h'ff h'00 ck tcnt overflow signal (internal signal) wovf figure 12.7 timing of setting the wovf bit
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 366 of 818 rej09b0273-0500 12.4 notes on use 12.4.1 tcnt write and increment contention if a timer counter increment clock pulse is generated during the t 3 state of a write cycle to the tcnt, the write takes priority and the timer counter is not incremented (figure 12.8). ck address internal write signal tcnt input clock tcnt nm tcnt address counter write data t 1 t 2 t 3 tcnt write cycle figure 12.8 contention between tcnt write and increment 12.4.2 changing cks2 to cks0 bit values if the values of bits cks2 to cks0 are altered while the wdt is running, the count may increment incorrectly. always stop the watchdog timer (by clearing the tme bit to 0) before changing the values of bits cks2 to cks0. 12.4.3 changing between watchdog timer/interval timer modes to prevent incorrect operation, always stop the watchdog timer (by clearing the tme bit to 0) before switching between interval timer mode and watchdog timer mode.
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 367 of 818 rej09b0273-0500 12.4.4 system reset with wdtovf wdtovf wdtovf wdtovf if a wdtovf signal is input to the res pin, the lsi cannot initialize correctly. avoid logical input of the wdtovf output signal to the res input pin. to reset the entire system with the wdtovf signal, use the circuit shown in figure 12.9. reset input reset signal to entire system sh7050 series res wdtovf figure 12.9 example of a system reset circuit with a wdtovf wdtovf wdtovf wdtovf signal 12.4.5 internal reset with the watchdog timer if the rste bit is cleared to 0 in the watchdog timer mode, the lsi will not reset internally when a tcnt overflow occurs, but the tcnt and tcsr in the wdt will reset.
section 12 watchdog timer (wdt) rev. 5.00 jan 06, 2006 page 368 of 818 rej09b0273-0500
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 369 of 818 rej09b0273-0500 section 13 serial communication interface (sci) 13.1 overview the sh7050 series has a serial communication interface (sci) with three independent channels, both of which possess the same functions. the sci supports both asynchronous and clock synchronous serial communication. it also has a multiprocessor communication function for serial communication among two or more processors. 13.1.1 features ? select asynchronous or clock synchronous as the serial communications mode. ? asynchronous mode: serial data communications are synched by start-stop in character units. the sci can communicate with a universal asynchronous receiver/transmitter (uart), an asynchronous communication interface adapter (acia), or any other chip that employs a standard asynchronous serial communication. it can also communicate with two or more other processors using the multiprocessor communication function. there are twelve selectable serial data communication formats. ? data length: seven or eight bits ? stop bit length: one or two bits ? parity: even, odd, or none ? multiprocessor bit: one or none ? receive error detection: parity, overrun, and framing errors ? break detection: by reading the rxd level directly when a framing error occurs ? clocked synchronous mode: serial data communication is synchronized with a clock signal. the sci can communicate with other chips having a clock synchronous communication function. there is one serial data communication format. ? data length: eight bits ? receive error detection: overrun errors ? full duplex communication: the transmitting and receiving sections are independent, so the sci can transmit and receive simultaneously. both sections use double buffering, so continuous data transfer is possible in both the transmit and receive directions. ? on-chip baud rate generator with selectable bit rates. ? internal or external transmit/receive clock source: baud rate generator (internal) or sck pin (external).
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 370 of 818 rej09b0273-0500 ? four types of interrupts: transmit-data-empty, transmit-end, receive-data-full, and receive- error interrupts are requested independently. the transmit-data-empty and receive-data-full interrupts can start the direct memory access controller (dmac)/data transfer controller (dtc) to transfer data. 13.1.2 block diagram figure 13.1 shows a block diagram of the sci. parity generation parity check transmit/ receive control baud rate generator clock external clock bus interface internal data bus rxd rdr tdr rsr tsr ssr scr smr brr /4 /16 /64 tei txi rxi eri sck : : : : rsr rdr tsr tdr receive shift register receive data register transmit shift register transmit data register : : : : smr scr ssr brr serial mode register serial control register serial status register bit rate register txd sci module data bus figure 13.1 sci block diagram
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 371 of 818 rej09b0273-0500 13.1.3 pin configuration table 13.1 summarizes the sci pins by channel. table 13.1 sci pins channel pin name abbreviation input/output function 0 serial clock pin sck0 input/output sci0 clock input/output receive data pin rxd0 input sci0 receive data input transmit data pin txd0 output sci0 transmit data output 1 serial clock pin sck1 input/output sci1 clock input/output receive data pin rxd1 input sci1 receive data input transmit data pin txd1 output sci2 transmit data output 2 serial clock pin sck2 input/output sci2 clock input/output receive data pin rxd2 input sci2 receive data input transmit data pin txd2 output sci2 transmit data output 13.1.4 register configuration table 13.2 summarizes the sci internal registers. these registers select the communication mode (asynchronous or clock synchronous), specify the data format and bit rate, and control the transmitter and receiver sections.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 372 of 818 rej09b0273-0500 table 13.2 registers channel name abbreviation r/w initial value address * 2 access size 0 serial mode register smr0 r/w h'00 h'ffff81a0 8, 16 bit rate register brr0 r/w h'ff h'ffff81a1 8, 16 serial control register scr0 r/w h'00 h'ffff81a2 8, 16 transmit data register tdr0 r/w h'ff h'ffff81a3 8, 16 serial status register ssr0 r/(w) * 1 h'84 h'ffff81a4 8, 16 receive data register rdr0 r h'00 h'ffff81a5 8, 16 1 serial mode register smr1 r/w h'00 h'ffff81b0 8, 16 bit rate register brr1 r/w h'ff h'ffff81b1 8, 16 serial control register scr1 r/w h'00 h'ffff81b2 8, 16 transmit data register tdr1 r/w h'ff h'ffff81b3 8, 16 serial status register ssr1 r/(w) * 1 h'84 h'ffff81b4 8, 16 receive data register rdr1 r h'00 h'ffff81b5 8, 16 2 serial mode register smr2 r/w h'00 h'ffff81c0 8, 16 bit rate register brr2 r/w h'ff h'ffff81c1 8, 16 serial control register scr2 r/w h'00 h'ffff81c2 8, 16 transmit data register tdr2 r/w h'ff h'ffff81c3 8, 16 serial status register ssr2 r/(w) * 1 h'84 h'ffff81c4 8, 16 receive data register rdr2 r h'00 h'ffff81c5 8, 16 notes: in register access, two cycles are required for byte access, and four cycles for word access. 1. the only value that can be written is a 0 to clear the flags. 2. do not access empty addresses.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 373 of 818 rej09b0273-0500 13.2 register descriptions 13.2.1 receive shift register (rsr) the receive shift register (rsr) receives serial data. data input at the rxd pin is loaded into the rsr in the order received, lsb (bit 0) first, converting the data to parallel form. when one byte has been received, it is automatically transferred to the rdr. the cpu cannot read or write the rsr directly. bit:76543210 r/w:???????? 13.2.2 receive data register (rdr) the receive data register (rdr) stores serial receive data. the sci completes the reception of one byte of serial data by moving the received data from the receive shift register (rsr) into the rdr for storage. the rsr is then ready to receive the next data. this double buffering allows the sci to receive data continuously. the cpu can read but not write the rdr. the rdr is initialized to h'00 by a power-on reset, in hardware standby mode and software standby mode. bit:76543210 initial value:00000000 r/w:rrrrrrrr
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 374 of 818 rej09b0273-0500 13.2.3 transmit shift register (tsr) the transmit shift register (tsr) transmits serial data. the sci loads transmit data from the transmit data register (tdr) into the tsr, then transmits the data serially from the txd pin, lsb (bit 0) first. after transmitting one data byte, the sci automatically loads the next transmit data from the tdr into the tsr and starts transmitting again. if the tdre bit of the ssr is 1, however, the sci does not load the tdr contents into the tsr. the cpu cannot read or write the tsr directly. bit:76543210 r/w:???????? 13.2.4 transmit data register (tdr) the transmit data register (tdr) is an 8-bit register that stores data for serial transmission. when the sci detects that the transmit shift register (tsr) is empty, it moves transmit data written in the tdr into the tsr and starts serial transmission. continuous serial transmission is possible by writing the next transmit data in the tdr during serial transmission from the tsr. the cpu can always read and write the tdr. the tdr is initialized to h'ff by a power-on reset, in hardware standby mode and software standby mode. bit:76543210 initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 375 of 818 rej09b0273-0500 13.2.5 serial mode register (smr) the serial mode register (smr) is an 8-bit register that specifies the sci serial communication format and selects the clock source for the baud rate generator. the cpu can always read and write the smr. the smr is initialized to h'00 by a power-on reset, in hardware standby mode and software standby mode. bit:76543210 c/ a chr pe o/ e stop mp cks1 cks0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit 7?communication mode (c/ a a a a ): selects whether the sci operates in the asynchronous or clock synchronous mode. bit 7: c/ a a a a description 0 asynchronous mode (initial value) 1 clocked synchronous mode bit 6?character length (chr): selects 7-bit or 8-bit data in the asynchronous mode. in the clock synchronous mode, the data length is always eight bits, regardless of the chr setting. bit 6: chr description 0 eight-bit data (initial value) 1 seven-bit data. (when 7-bit data is selected, the msb (bit 7) of the transmit data register is not transmitted.) bit 5?parity enable (pe): selects whether to add a parity bit to transmit data and to check the parity of receive data, in the asynchronous mode. in the clock synchronous mode, a parity bit is neither added nor checked, regardless of the pe setting. bit 5: pe description 0 parity bit not added or checked (initial value) 1 parity bit added and checked. when pe is set to 1, an even or odd parity bit is added to transmit data, depending on the parity mode (o/ e ) setting. receive data parity is checked according to the even/odd (o/ e ) mode setting.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 376 of 818 rej09b0273-0500 bit 4?parity mode (o/ e e e e ): selects even or odd parity when parity bits are added and checked. the o/ e setting is used only in asynchronous mode and only when the parity enable bit (pe) is set to 1 to enable parity addition and check. the o/ e setting is ignored in the clock synchronous mode, or in the asynchronous mode when parity addition and check is disabled. bit 4: o/ e e e e description 0 even parity (initial value). if even parity is selected, the parity bit is added to transmit data to make an even number of 1s in the transmitted character and parity bit combined. receive data is checked to see if it has an even number of 1s in the received character and parity bit combined. 1 odd parity. if odd parity is selected, the parity bit is added to transmit data to make an odd number of 1s in the transmitted character and parity bit combined. receive data is checked to see if it has an odd number of 1s in the received character and parity bit combined. bit 3?stop bit length (stop): selects one or two bits as the stop bit length in the asynchronous mode. this setting is used only in the asynchronous mode. it is ignored in the clock synchronous mode because no stop bits are added. in receiving, only the first stop bit is checked, regardless of the stop bit setting. if the second stop bit is 1, it is treated as a stop bit, but if the second stop bit is 0, it is treated as the start bit of the next incoming character. bit 3: stop description 0 one stop bit (initial value). in transmitting, a single bit of 1 is added at the end of each transmitted character. 1 two stop bits. in transmitting, two bits of 1 are added at the end of each transmitted character. bit 2?multiprocessor mode (mp): selects multiprocessor format. when multiprocessor format is selected, settings of the parity enable (pe) and parity mode (o/ e ) bits are ignored. the mp bit setting is used only in the asynchronous mode; it is ignored in the clock synchronous mode. for the multiprocessor communication function, see section 13.3.3, multiprocessor communication. bit 2: mp description 0 multiprocessor function disabled (initial value) 1 multiprocessor format selected
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 377 of 818 rej09b0273-0500 bits 1 and 0?clock select 1 and 0 (cks1 and cks0): these bits select the internal clock source of the on-chip baud rate generator. four clock sources are available; , /4, /16, or /64. for further information on the clock source, bit rate register settings, and baud rate, see section 13.2.8, bit rate register. bit 1: cks1 bit 0: cks0 description 00 (initial value) 1 /4 10 /16 1 /64 13.2.6 serial control register (scr) the serial control register (scr) operates the sci transmitter/receiver, selects the serial clock output in the asynchronous mode, enables/disables interrupt requests, and selects the transmit/receive clock source. the cpu can always read and write the scr. the scr is initialized to h'00 by a power-on reset, in hardware standby mode and software standby mode. manual reset does not initialize scr. bit:76543210 tie rie te re mpie teie cke1 cke0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit 7?transmit interrupt enable (tie): enables or disables the transmit-data-empty interrupt (txi) requested when the transmit data register empty bit (tdre) in the serial status register (ssr) is set to 1 by transfer of serial transmit data from the tdr to the tsr. bit 7: tie description 0 transmit-data-empty interrupt request (txi) is disabled (initial value). the txi interrupt request can be cleared by reading tdre after it has been set to 1, then clearing tdre to 0, or by clearing tie to 0. 1 transmit-data-empty interrupt request (txi) is enabled
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 378 of 818 rej09b0273-0500 bit 6?receive interrupt enable (rie): enables or disables the receive-data-full interrupt (rxi) requested when the receive data register full bit (rdrf) in the serial status register (ssr) is set to 1 by transfer of serial receive data from the rsr to the rdr. it also enables or disables receive- error interrupt (eri) requests. bit 6: rie description 0 receive-data-full interrupt (rxi) and receive-error interrupt (eri) requests are disabled (initial value). rxi and eri interrupt requests can be cleared by reading the rdrf flag or error flag (fer, per, or orer) after it has been set to 1, then clearing the flag to 0, or by clearing rie to 0. 1 receive-data-full interrupt (rxi) and receive-error interrupt (eri) requests are enabled. bit 5?transmit enable (te): enables or disables the sci serial transmitter. bit 5: te description 0 transmitter disabled (initial value). the transmit data register empty bit (tdre) in the serial status register (ssr) is locked at 1. 1 transmitter enabled. serial transmission starts when the transmit data register empty (tdre) bit in the serial status register (ssr) is cleared to 0 after writing of transmit data into the tdr. select the transmit format in the smr before setting te to 1. bit 4?receive enable (re): enables or disables the sci serial receiver. bit 4: re description 0 receiver disabled (initial value). clearing re to 0 does not affect the receive flags (rdrf, fer, per, orer). these flags retain their previous values. 1 receiver enabled. serial reception starts when a start bit is detected in the asynchronous mode, or synchronous clock input is detected in the clock synchronous mode. select the receive format in the smr before setting re to 1.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 379 of 818 rej09b0273-0500 bit 3?multiprocessor interrupt enable (mpie): enables or disables multiprocessor interrupts. the mpie setting is used only in the asynchronous mode, and only if the multiprocessor mode bit (mp) in the serial mode register (smr) is set to 1 during reception. the mpie setting is ignored in the clock synchronous mode or when the mp bit is cleared to 0. bit 3: mpie description 0 multiprocessor interrupts are disabled (normal receive operation) (initial value). mpie is cleared when the mpie bit is cleared to 0, or the multiprocessor bit (mpb) is set to 1 in receive data. 1 multiprocessor interrupts are enabled. receive-data-full interrupt requests (rxi), receive-error interrupt requests (eri), and setting of the rdrf, fer, and orer status flags in the serial status register (ssr) are disabled until data with the multiprocessor bit set to 1 is received. the sci does not transfer receive data from the rsr to the rdr, does not detect receive errors, and does not set the rdrf, fer, and orer flags in the serial status register (ssr). when it receives data that includes mpb = 1, mpb is set to 1, and the sci automatically clears mpie to 0, generates rxi and eri interrupts (if the tie and rie bits in the scr are set to 1), and allows the fer and orer bits to be set. bit 2?transmit-end interrupt enable (teie): enables or disables the transmit-end interrupt (tei) requested if tdr does not contain valid transmit data when the msb is transmitted. bit 2: teie description 0 transmit-end interrupt (tei) requests are disabled * (initial value) 1 transmit-end interrupt (tei) requests are enabled. * note: the tei request can be cleared by reading the tdre bit in the serial status register (ssr) after it has been set to 1, then clearing tdre to 0 and clearing the transmit end (tend) bit to 0; or by clearing the teie bit to 0. bits 1 and 0?clock enable 1 and 0 (cke1 and cke0): these bits select the sci clock source and enable or disable clock output from the sck pin. depending on the combination of cke1 and cke0, the sck pin can be used for serial clock output, or serial clock input. select the sck pin function by using the pin function controller (pfc). the cke0 setting is valid only in the asynchronous mode, and only when the sci is internally clocked (cke1 = 0). the cke0 setting is ignored in the clock synchronous mode, or when an external clock source is selected (cke1 = 1). select the sci operating mode in the serial mode register (smr) before setting cke1 and cke0. for further details on selection of the sci clock source, see table 13.10 in section 13.3, operation.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 380 of 818 rej09b0273-0500 bit 1: cke1 bit 0: cke0 description * 1 0 0 asynchronous mode internal clock, sck pin used for input pin (input signal is ignored) or output pin (output level is undefined) * 2 clock synchronous mode internal clock, sck pin used for synchronous clock output * 2 0 1 asynchronous mode internal clock, sck pin used for clock output * 3 clock synchronous mode internal clock, sck pin used for synchronous clock output 1 0 asynchronous mode external clock, sck pin used for clock input * 4 clock synchronous mode external clock, sck pin used for synchronous clock input 1 1 asynchronous mode external clock, sck pin used for clock input * 4 clock synchronous mode external clock, sck pin used for synchronous clock input notes: 1. the sck pin is multiplexed with other functions. use the pin function controller (pfc) to select the sck function for this pin, as well as the i/o direction. 2. initial value. 3. the output clock frequency is the same as the bit rate. 4. the input clock frequency is 16 times the bit rate. 13.2.7 serial status register (ssr) the serial status register (ssr) is an 8-bit register containing multiprocessor bit values, and status flags that indicate sci operating status. the cpu can always read and write the ssr, but cannot write 1 in the status flags (tdre, rdrf, orer, per, and fer). these flags can be cleared to 0 only if they have first been read (after being set to 1). bits 2 (tend) and 1 (mpb) are read-only bits that cannot be written. the ssr is initialized to h'84 by a power-on reset, in hardware standby mode and software standby mode. manual reset does not initialize ssr. bit:76543210 tdre rdrf orer fer per tend mpb mpbt initial value:10000100 r/w: r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * rrr/w note: * the only value that can be written is a 0 to clear the flag.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 381 of 818 rej09b0273-0500 bit 7?transmit data register empty (tdre): indicates that the sci has loaded transmit data from the tdr into the tsr and new serial transmit data can be written in the tdr. bit 7: tdre description 0 tdr contains valid transmit data tdre is cleared to 0 when software reads tdre after it has been set to 1, then writes 0 in tdre or the dmac writes data in tdr 1 tdr does not contain valid transmit data (initial value) tdre is set to 1 when the chip is power-on reset or enters standby mode, the te bit in the serial control register (scr) is cleared to 0, or tdr contents are loaded into tsr, so new data can be written in tdr bit 6?receive data register full (rdrf): indicates that rdr contains received data. bit 6: rdrf description 0 rdr does not contain valid received data (initial value) rdrf is cleared to 0 when the chip is power-on reset or enters standby mode, software reads rdrf after it has been set to 1, then writes 0 in rdrf, or the dmac reads data from rdr 1 rdr contains valid received data rdrf is set to 1 when serial data is received normally and transferred from rsr to rdr note: the rdr and rdrf are not affected by detection of receive errors or by clearing of the re bit to 0 in the serial control register. they retain their previous contents. if rdrf is still set to 1 when reception of the next data ends, an overrun error (orer) occurs and the received data is lost.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 382 of 818 rej09b0273-0500 bit 5?overrun error (orer): indicates that data reception ended abnormally due to an overrun error. bit 5: orer description 0 receiving is in progress or has ended normally (initial value). clearing the re bit to 0 in the serial control register does not affect the orer bit, which retains its previous value. orer is cleared to 0 when the chip is power-on reset or enters standby mode or software reads orer after it has been set to 1, then writes 0 in orer 1 a receive overrun error occurred. rdr continues to hold the data received before the overrun error, so subsequent receive data is lost. serial receiving cannot continue while orer is set to 1. in the clock synchronous mode, serial transmitting is disabled. orer is set to 1 if reception of the next serial data ends when rdrf is set to 1 bit 4?framing error (fer): indicates that data reception ended abnormally due to a framing error in the asynchronous mode. bit 4: fer description 0 receiving is in progress or has ended normally (initial value). clearing the re bit to 0 in the serial control register does not affect the fer bit, which retains its previous value. fer is cleared to 0 when the chip is power-on reset or enters standby mode or software reads fer after it has been set to 1, then writes 0 in fer 1 a receive framing error occurred. when the stop bit length is two bits, only the first bit is checked to see if it is a 1. the second stop bit is not checked. when a framing error occurs, the sci transfers the receive data into the rdr but does not set rdrf. serial receiving cannot continue while fer is set to 1. in the clock synchronous mode, serial transmitting is also disabled. fer is set to 1 if the stop bit at the end of receive data is checked and found to be 0
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 383 of 818 rej09b0273-0500 bit 3?parity error (per): indicates that data reception (with parity) ended abnormally due to a parity error in the asynchronous mode. bit 3: per description 0 receiving is in progress or has ended normally (initial value). clearing the re bit to 0 in the serial control register does not affect the per bit, which retains its previous value. per is cleared to 0 when the chip is power-on reset or enters standby mode or software reads per after it has been set to 1, then writes 0 in per 1 a receive parity error occurred. when a parity error occurs, the sci transfers the receive data into the rdr but does not set rdrf. serial receiving cannot continue while per is set to 1. in the clock synchronous mode, serial transmitting is also disabled. per is set to 1 if the number of 1s in receive data, including the parity bit, does not match the even or odd parity setting of the parity mode bit (o/ e ) in the serial mode register (smr) bit 2?transmit end (tend): indicates that when the last bit of a serial character was transmitted, the tdr did not contain valid data, so transmission has ended. tend is a read-only bit and cannot be written. bit 2: tend description 0 transmission is in progress tend is cleared to 0 when software reads tdre after it has been set to 1, then writes 0 in tdre, or the dmac writes data in tdr 1 end of transmission (initial value) tend is set to 1 when the chip is power-on reset or enters standby mode, te is cleared to 0 in the serial control register (scr), or tdre is 1 when the last bit of a one-byte serial character is transmitted. bit 1?multiprocessor bit (mpb): stores the value of the multiprocessor bit in receive data when a multiprocessor format is selected for receiving in the asynchronous mode. the mpb is a read-only bit and cannot be written. bit 1: mpb description 0 multiprocessor bit value in receive data is 0 (initial value). if re is cleared to 0 when a multiprocessor format is selected, the mpb retains its previous value. 1 multiprocessor bit value in receive data is 1
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 384 of 818 rej09b0273-0500 bit 0?multiprocessor bit transfer (mpbt): stores the value of the multiprocessor bit added to transmit data when a multiprocessor format is selected for transmitting in the asynchronous mode. the mpbt setting is ignored in the clock synchronous mode, when a multiprocessor format is not selected, or when the sci is not transmitting. bit 0: mpbt description 0 multiprocessor bit value in transmit data is 0 (initial value) 1 multiprocessor bit value in transmit data is 1 13.2.8 bit rate register (brr) the bit rate register (brr) is an 8-bit register that, together with the baud rate generator clock source selected by the cks1 and cks0 bits in the serial mode register (smr), determines the serial transmit/receive bit rate. the cpu can always read and write the brr. the brr is initialized to h'ff by a power-on reset, in hardware standby mode and software standby mode. each channel has independent baud rate generator control, so different values can be set in the two channels. bit:76543210 initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table 13.3 lists examples of brr settings in the asynchronous mode; table 13.4 lists examples of bbr settings in the clock synchronous mode.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 385 of 818 rej09b0273-0500 the brr setting is calculated as follows: asynchronous mode: n = 64 2 2n ? 1 b 10 6 ? 1 synchronous mode: n = 8 2 2n ? 1 b 10 6 ? 1 b: bit rate (bit/s) n: baud rate generator brr setting (0 n 255) : operating frequency (mhz) n: baud rate generator input clock (n = 0 to 3) (see the following table for the clock sources and value of n.) smr settings n clock source cks1 cks2 0 00 1 /4 0 1 2 /16 1 0 3 /64 1 1 the bit rate error in asynchronous mode is calculated as follows: error (%) = (n + 1) b 64 2 2n ? 1 ? 1 100 10 6
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 386 of 818 rej09b0273-0500 table 13.3 bit rates and brr settings in asynchronous mode (mhz) 4 4.9152 6 bit rate (bits/s) n n error (%) n n error (%) n n error (%) 110 2 70 0.03 2 86 0.31 2 106 ? 0.44 150 1 207 0.16 1 255 0.00 2 77 0.16 300 1 103 0.16 1 127 0.00 1 155 0.16 600 0 207 0.16 0 255 0.00 1 77 0.16 1200 0 103 0.16 0 127 0.00 0 155 0.16 2400 0 51 0.16 0 63 0.00 0 77 0.16 4800 0 25 0.16 0 31 0.00 0 38 0.16 9600 0 12 0.16 0 15 0.00 0 19 ? 2.34 14400 0 8 ? 3.55 0 10 ? 3.03 0 12 0.16 19200 0 6 ? 6.99 0 7 0.00 0 9 ? 2.34 28800 0 3 8.51 0 4 6.67 0 6 ? 6.99 31250 0 3 0.00 0 4 ? 1.70 0 5 0.00 38400 0 2 8.51 0 3 0.00 0 4 ? 2.34
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 387 of 818 rej09b0273-0500 (mhz) 7.3728 8 9.8304 bit rate (bits/s) n n error (%) n n error (%) n n error (%) 110 2 130 ? 0.07 2 141 0.03 2 174 0.26 150 2 95 0.00 2 103 0.16 2 127 0.00 300 1 191 0.00 1 207 0.16 1 255 0.00 600 1 95 0.00 1 103 0.16 1 127 0.00 1200 0 191 0.00 0 207 0.16 0 255 0.00 2400 0 95 0.00 0 103 0.16 0 127 0.00 4800 0 47 0.00 0 51 0.16 0 63 0.00 9600 0 23 0.00 0 25 0.16 0 31 0.00 14400 0 15 0.00 0 16 2.12 0 20 1.59 19200 0 11 0.00 0 12 0.16 0 15 0.00 28800 0 7 0.00 0 8 ? 3.55 0 10 ? 3.03 31250 0 6 0.54 0 7 0.00 0 9 ? 1.70 38400 0 5 0.00 0 6 ? 6.99 0 7 0.00 (mhz) 10 11.0592 12 bit rate (bits/s) n n error (%) n n error (%) n n error (%) 110 2 177 ? 0.25 2 195 0.19 2 212 0.03 150 2 129 0.16 2 143 0.00 2 155 0.16 300 2 64 0.16 2 71 0.00 2 77 0.16 600 1 129 0.16 1 143 0.00 1 155 0.16 1200 1 64 0.16 1 71 0.00 1 77 0.16 2400 0 129 0.16 0 143 0.00 0 155 0.16 4800 0 64 0.16 0 71 0.00 0 77 0.16 9600 0 32 ? 1.36 0 35 0.00 0 38 0.16 14400 0 21 ? 1.36 0 23 0.00 0 25 0.16 19200 0 15 1.73 0 19 0.00 0 19 ? 2.34 28800 0 10 ? 1.36 0 11 0.00 0 12 0.16 31250 0 9 0.00 0 10 0.54 0 11 0.00 38400 0 7 1.73 0 8 0.00 0 9 ? 2.34
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 388 of 818 rej09b0273-0500 (mhz) 12.288 14 14.7456 bit rate (bits/s) n n error (%) n n error (%) n n error (%) 110 2 217 0.08 2 248 ? 0.17 3 64 0.70 150 2 159 0.00 2 181 0.16 2 191 0.00 300 2 79 0.00 2 90 0.16 2 95 0.00 600 1 159 0.00 1 181 0.16 1 191 0.00 1200 1 79 0.00 1 90 0.16 1 95 0.00 2400 0 159 0.00 0 181 0.16 0 191 0.00 4800 0 79 0.00 0 90 0.16 0 95 0.00 9600 0 39 0.00 0 45 ? 0.93 0 47 0.00 14400 0 26 ? 1.23 0 29 1.27 0 31 0.00 19200 0 19 0.00 0 22 ? 0.93 0 23 0.00 28800 0 12 2.56 0 14 1.27 0 15 0.00 31250 0 11 2.40 0 13 0.00 0 14 ? 1.70 38400 0 9 0.00 0 10 3.57 0 11 0.00 (mhz) 16 17.2032 18 bit rate (bits/s) n n error (%) n n error (%) n n error (%) 110 3 70 0.03 3 75 0.48 3 79 ? 0.12 150 2 207 0.16 2 223 0.00 2 233 0.16 300 2 103 0.16 2 111 0.00 2 116 0.16 600 1 207 0.16 1 223 0.00 1 233 0.16 1200 1 103 0.16 1 111 0.00 1 116 0.16 2400 0 207 0.16 0 223 0.00 0 233 0.16 4800 0 103 0.16 0 111 0.00 0 116 0.16 9600 0 51 0.16 0 55 0.00 0 58 ? 0.69 14400 0 34 ? 0.79 0 36 0.90 0 38 0.16 19200 0 25 0.16 0 27 0.00 0 28 1.02 28800 0 16 2.12 0 18 ? 1.75 0 19 ? 2.34 31250 0 15 0.00 0 16 1.20 0 17 0.00 38400 0 12 0.16 0 13 0.00 0 14 ? 2.34
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 389 of 818 rej09b0273-0500 (mhz) 18.432 19.6608 20 bit rate (bits/s) n n error (%) n n error (%) n n error (%) 110 3 81 ? 0.22 3 86 0.31 3 88 ? 0.25 150 2 239 0.00 2 255 0.00 3 64 0.16 300 2 119 0.00 2 127 0.00 2 129 0.16 600 1 239 0.00 1 255 0.00 2 64 0.16 1200 1 119 0.00 1 127 0.00 1 129 0.16 2400 0 239 0.00 0 255 0.00 1 64 0.16 4800 0 119 0.00 0 127 0.00 0 129 0.16 9600 0 59 0.00 0 63 0.00 0 64 0.16 14400 0 39 0.00 0 42 ? 0.78 0 42 0.94 19200 0 29 0.00 0 31 0.00 0 32 ? 1.36 28800 0 19 0.00 0 20 1.59 0 21 ? 1.36 31250 0 17 2.40 0 19 ? 1.70 0 19 0.00 38400 0 14 0.00 0 15 0.00 0 15 1.73
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 390 of 818 rej09b0273-0500 table 13.4 bit rates and brr settings in clocked synchronous mode (mhz) 4 8 10 12 bit rate (bits/s) n n n n n n n n 110 3 141 3 212 3 212 3 212 250 2 249 3 124 3 155 3 187 500 2 124 2 249 3 77 3 93 1k 1 249 2 124 2 155 2 187 2.5k 1 99 1 199 1 249 2 74 5k 0 199 1 99 1 124 1 149 10k 0 99 0 199 0 249 1 74 25k 0 39 0 79 0 99 0 119 50k 0 19 0 39 0 49 0 59 100k 0 9 0 19 0 24 0 29 250k 0 3 0 7 0 9 0 11 500k 0 1 0 3 0 4 0 5 1m 0 1 ?? 02 2.5m 0 0 * 00 * 5m
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 391 of 818 rej09b0273-0500 (mhz) 16 20 bit rate (bits/s) n n n n 110 3 212 3 212 250 3 249 3 249 500 3 124 3 155 1k 2 249 3 77 2.5k 2 99 2 124 5k 1 199 2 249 10k 1 99 1 124 25k 0 159 1 199 50k 0 79 0 99 100k 0 39 0 49 250k 0 15 0 19 500k 0 7 0 9 1m 0 3 0 4 2.5m ?? 01 5m 0 0 * note: * settings with an error of 1% or less are recommended. legend: blank: no setting available ? : setting possible, but error occurs table 13.5 indicates the maximum bit rates in the asynchronous mode when the baud rate generator is being used for various frequencies. tables 13.6 and 13.7 show the maximum rates for external clock input.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 392 of 818 rej09b0273-0500 table 13.5 maximum bit rates for various frequencies with baud rate generator (asynchronous mode) settings (mhz) maximum bit rate (bits/s) n n 4 125000 0 0 4.9152 153600 0 0 6 187500 0 0 7.3728 230400 0 0 8 250000 0 0 9.8304 307200 0 0 10 312500 0 0 11.0592 345600 0 0 12 375000 0 0 12.288 384000 0 0 14 437500 0 0 14.7456 460800 0 0 16 500000 0 0 17.2032 537600 0 0 18 562500 0 0 18.432 576000 0 0 19.6608 614400 0 0 20 625000 0 0
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 393 of 818 rej09b0273-0500 table 13.6 maximum bit rates during external clock input (asynchronous mode) (mhz) external input clock (mhz) maximum bit rate (bits/s) 4 1.0000 62500 4.9152 1.2288 76800 6 1.5000 93750 7.3728 1.8432 115200 8 2.0000 125000 9.8304 2.4576 153600 10 2.5000 156250 11.0592 2.7648 172800 12 3.0000 187500 12.288 3.0720 192000 14 3.5000 218750 14.7456 3.6864 230400 16 4.0000 250000 17.2032 4.3008 268800 18 4.5000 281250 18.432 4.6080 288000 19.6608 4.9152 307200 20 5.0000 312500 table 13.7 maximum bit rates during external clock input (clock synchronous mode) (mhz) external input clock (mhz) maximum bit rate (bits/s) 4 0.6667 666666.7 6 1.0000 1000000.0 8 1.3333 1333333.3 10 1.6667 1666666.7 12 2.0000 2000000.0 14 2.3333 2333333.3 16 2.6667 2666666.7 18 3.0000 3000000.0 20 3.3333 3333333.3
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 394 of 818 rej09b0273-0500 13.3 operation 13.3.1 overview for serial communication, the sci has an asynchronous mode in which characters are synchronized individually, and a clock synchronous mode in which communication is synchronized with clock pulses. asynchronous/clock synchronous mode and the transmission format are selected in the serial mode register (smr), as shown in table 13.8. the sci clock source is selected by the c/ a bit in the serial mode register (smr) and the cke1 and cke0 bits in the serial control register (scr), as shown in table 13.9. asynchronous mode: ? data length is selectable: seven or eight bits. ? parity and multiprocessor bits are selectable, as well as the stop bit length (one or two bits). these selections determine the transmit/receive format and character length. ? in receiving, it is possible to detect framing errors (fer), parity errors (per), overrun errors (orer), and the break state. ? an internal or external clock can be selected as the sci clock source. ? when an internal clock is selected, the sci operates using the on-chip baud rate generator clock, and can output a clock with a frequency matching the bit rate. ? when an external clock is selected, the external clock input must have a frequency 16 times the bit rate. (the on-chip baud rate generator is not used.) clock synchronous mode: ? the communication format has a fixed 8-bit data length. ? in receiving, it is possible to detect overrun errors (orer). ? an internal or external clock can be selected as the sci clock source. ? when an internal clock is selected, the sci operates using the on-chip baud rate generator clock, and outputs a synchronous clock signal to external devices. ? when an external clock is selected, the sci operates on the input synchronous clock. the on-chip baud rate generator is not used.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 395 of 818 rej09b0273-0500 table 13.8 serial mode register settings and sci communication formats smr settings sci communication format mode bit 7 c/ a a a a bit 6 chr bit 5 pe bit 2 mp bit 3 stop data length parity bit multipro- cessor bit stop bit length 01 bit 0 1 not set 2 bits 01 bit 0 1 1 8-bit set 2 bits 01 bit 0 1 not set 2 bits 01 bit asynchronous 1 1 0 1 7-bit set not set 2 bits * 01 bit 0 * 1 8-bit 2 bits * 01 bit asynchronous (multiprocessor format) 0 1 * 1 1 7-bit set 2 bits clock synchronous 1 *** * 8-bit not set not set none note: asterisks ( * ) in the table indicate don ? t-care bits. table 13.9 smr and scr settings and sci clock source selection smr scr settings sci transmit/receive clock mode bit 7 c/ a a a a bit 1 cke1 bit 0 cke0 clock source sck pin function * 0 sci does not use the sck pin 0 1 internal outputs a clock with frequency matching the bit rate 0 asynchronous 0 1 1 external inputs a clock with frequency 16 times the bit rate 0 0 1 internal outputs the synchronous clock 0 clock synch- ronous 1 1 1 external inputs the synchronous clock note: * select the function in combination with the pin function controller (pfc).
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 396 of 818 rej09b0273-0500 13.3.2 operation in asynchronous mode in the asynchronous mode, each transmitted or received character begins with a start bit and ends with a stop bit. serial communication is synchronized one character at a time. the transmitting and receiving sections of the sci are independent, so full duplex communication is possible. the transmitter and receiver are both double buffered, so data can be written and read while transmitting and receiving are in progress, enabling continuous transmitting and receiving. figure 13.2 shows the general format of asynchronous serial communication. in asynchronous serial communication, the communication line is normally held in the marking (high) state. the sci monitors the line and starts serial communication when the line goes to the space (low) state, indicating a start bit. one serial character consists of a start bit (low), data (lsb first), parity bit (high or low), and stop bit (high), in that order. when receiving in the asynchronous mode, the sci synchronizes on the falling edge of the start bit. the sci samples each data bit on the eighth pulse of a clock with a frequency 16 times the bit rate. receive data is latched at the center of each bit. 0 d0d1d2d3d4d5d6d7 1 1 0/1 1 1 (lsb) (msb) serial data start bit 1 bit transmit/receive data 7 or 8 bits one unit of communication data (characters or frames) idling (marking state) parity bit stop bit 1 or no bit 1 or 2 bits figure 13.2 data format in asynchronous communication (example: 8-bit data with parity and two stop bits)
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 397 of 818 rej09b0273-0500 transmit/receive formats: table 13.10 shows the 12 communication formats that can be selected in the asynchronous mode. the format is selected by settings in the serial mode register (smr). table 13.10 serial communication formats (asynchronous mode) smr bits serial transmit/receive format and frame length chrpempstop 1 2345678 9 10 11 12 0 0 0 0 start 8-bit data stop 0 0 0 1 start 8-bit data stop stop 0 1 0 0 start 8-bit data p stop 0 1 0 1 start 8-bit data p stop stop 1 0 0 0 start 7-bit data stop 1 0 0 1 start 7-bit data stop stop 1 1 0 0 start 7-bit data p stop 1 1 0 1 start 7-bit data p stop stop 0 ? 1 0 start 8-bit data mpb stop 0 ? 1 1 start 8-bit data mpb stop stop 1 ? 1 0 start 7-bit data mpb stop 1 ? 1 1 start 7-bit data mpb stop stop ? : don ? t care bits. note: start: start bit stop: stop bit p: parity bit mpb: multiprocessor bit clock: an internal clock generated by the on-chip baud rate generator or an external clock input from the sck pin can be selected as the sci transmit/receive clock. the clock source is selected by the c/ a bit in the serial mode register (smr) and bits cke1 and cke0 in the serial control register (scr) (table 13.9).
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 398 of 818 rej09b0273-0500 when an external clock is input at the sck pin, it must have a frequency equal to 16 times the desired bit rate. when the sci operates on an internal clock, it can output a clock signal at the sck pin. the frequency of this output clock is equal to the bit rate. the phase is aligned as in figure 13.3 so that the rising edge of the clock occurs at the center of each transmit data bit. 0 d0d1d2d3d4d5d6d70/1 1 1 1 frame figure 13.3 output clock and communication data phase relationship (asynchronous mode) sci initialization (asynchronous mode): before transmitting or receiving, clear the te and re bits to 0 in the serial control register (scr), then initialize the sci as follows. when changing the operation mode or communication format, always clear the te and re bits to 0 before following the procedure given below. clearing te to 0 sets tdre to 1 and initializes the transmit shift register (tsr). clearing re to 0, however, does not initialize the rdrf, per, fer, and orer flags and receive data register (rdr), which retain their previous contents. when an external clock is used, the clock should not be stopped during initialization or subsequent operation. sci operation becomes unreliable if the clock is stopped. figure 13.4 is a sample flowchart for initializing the sci. the procedure is as follows (the steps correspond to the numbers in the flowchart): 1. select the communication format in the serial mode register (smr). 2. write the value corresponding to the bit rate in the bit rate register (brr) unless an external clock is used. 3. select the clock source in the serial control register (scr). leave rie, tie, teie, mpie, te and re cleared to 0. if clock output is selected in asynchronous mode, clock output starts immediately after the setting is made to scr. 4. wait for at least the interval required to transmit or receive one bit, then set te or re in the serial control register (scr) to 1. also set rie, tie, teie and mpie as necessary. setting te or re enables the sci to use the txd or rxd pin. the initial states are the marking transmit state, and the idle receive state (waiting for a start bit).
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 399 of 818 rej09b0273-0500 initialize clear te and re bits to 0 in scr set cke1 and cke0 bits in scr (te and re bits are 0) select transmit/receive format in smr set value to brr set te or re to 1 in scr; set rie, tie, teie, and mpie as necessary 1-bit interval elapsed? end 3 1 2 4 no yes figure 13.4 sample flowchart for sci initialization transmitting serial data (asynchronous mode): figure 13.5 shows a sample flowchart for transmitting serial data. the procedure is as follows (the steps correspond to the numbers in the flowchart): 1. sci initialization: set the txd pin using the pfc. 2. sci status check and transmit data write: read the serial status register (ssr), check that the tdre bit is 1, then write transmit data in the transmit data register (tdr) and clear tdre to 0. 3. continue transmitting serial data: read the tdre bit to check whether it is safe to write (if it reads 1); if so, write data in tdr, then clear tdre to 0. when the dmac is started by a transmit-data-empty interrupt request (txi) in order to write data in tdr, the tdre bit is checked and cleared automatically. 4. to output a break at the end of serial transmission, first clear the port data register (dr) to 0, then clear the te to 0 in scr and use the pfc to establish the txd pin as an output port.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 400 of 818 rej09b0273-0500 start transmitting initialize read tdre bit in ssr read tend bit in ssr clear te bit in scr to 0; select thetxd pin as an output port with the pfc tend = 1? end transmission 1 2 3 no yes tdre = 1? write transmission data to tdr and clear tdre bit in ssr to 0 all data transmitted? no yes output break signal? no yes set dr = 0 4 yes no figure 13.5 sample flowchart for transmitting serial data
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 401 of 818 rej09b0273-0500 in transmitting serial data, the sci operates as follows: 1. the sci monitors the tdre bit in the ssr. when tdre is cleared to 0, the sci recognizes that the transmit data register (tdr) contains new data, and loads this data from the tdr into the transmit shift register (tsr). 2. after loading the data from the tdr into the tsr, the sci sets the tdre bit to 1 and starts transmitting. if the transmit-data-empty interrupt enable bit (tie) is set to 1 in the scr, the sci requests a transmit-data-empty interrupt (txi) at this time. serial transmit data is transmitted in the following order from the txd pin: a. start bit: one 0 bit is output. b. transmit data: seven or eight bits of data are output, lsb first. c. parity bit or multiprocessor bit: one parity bit (even or odd parity) or one multiprocessor bit is output. formats in which neither a parity bit nor a multiprocessor bit is output can also be selected. d. stop bit: one or two 1 bits (stop bits) are output. e. marking: output of 1 bits continues until the start bit of the next transmit data. 3. the sci checks the tdre bit when it outputs the stop bit. if tdre is 0, the sci loads new data from the tdr into the tsr, outputs the stop bit, then begins serial transmission of the next frame. if tdre is 1, the sci sets the tend bit to 1 in the ssr, outputs the stop bit, then continues output of 1 bits (marking). if the transmit-end interrupt enable bit (teie) in the scr is set to 1, a transmit-end interrupt (tei) is requested. figure 13.6 shows an example of sci transmit operation in the asynchronous mode.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 402 of 818 rej09b0273-0500 01 1 1 0/1 0 1 tdre tend parity bit parity bit serial data start bit data stop bit start bit data stop bit idle (marking state) txi interrupt request txi interrupt handler writes data in tdr and clears tdre to 0 txi request tei interrupt request 1 frame d0 d1 d7 d0 d1 d7 0/1 example: 8-bit data with parity and one stop bit figure 13.6 sci transmit operation in asynchronous mode receiving serial data (asynchronous mode): figures 13.7 and 13.8 show a sample flowchart for receiving serial data. the procedure is as follows (the steps correspond to the numbers in the flowchart). 1. sci initialization: set the rxd pin using the pfc. 2. receive error handling and break detection: if a receive error occurs, read the orer, per, and fer bits of the ssr to identify the error. after executing the necessary error handling, clear orer, per, and fer all to 0. receiving cannot resume if orer, per or fer remain set to 1. when a framing error occurs, the rxd pin can be read to detect the break state. 3. sci status check and receive-data read: read the serial status register (ssr), check that rdrf is set to 1, then read receive data from the receive data register (rdr) and clear rdrf to 0. the rxi interrupt can also be used to determine if the rdrf bit has changed from 0 to 1. 4. continue receiving serial data: read the rdr and rdrf bit and clear rdrf to 0 before the stop bit of the current frame is received. if the dmac is started by a receive-data-full interrupt (rxi) to read rdr, the rdrf bit is cleared automatically so this step is unnecessary.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 403 of 818 rej09b0273-0500 start reception initialization read orer, per, and fer bits in ssr read reception data of rdr and clear rdrf bit in ssr to 0 end reception 1 4 no no yes yes read the rdrf bit in ssr rdrf = 1? per, fer, orer = 1? clear the re bit of scr to 0 yes no 3 error handling 2 all data received? figure 13.7 sample flowchart for receiving serial data (1)
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 404 of 818 rej09b0273-0500 start of error handling orer = 1? overrun error handling fer = 1? yes break? no framing error handling per = 1? yes parity error handling clear orer, per, and fer to 0 in ssr end clear re bit in scr to 0 no no no yes yes figure 13.8 sample flowchart for receiving serial data (2)
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 405 of 818 rej09b0273-0500 in receiving, the sci operates as follows: 1. the sci monitors the communication line. when it detects a start bit (0), the sci synchronizes internally and starts receiving. 2. receive data is shifted into the rsr in order from the lsb to the msb. 3. the parity bit and stop bit are received. after receiving these bits, the sci makes the following checks: a. parity check. the number of 1s in the receive data must match the even or odd parity setting of the o/e bit in the smr. b. stop bit check. the stop bit value must be 1. if there are two stop bits, only the first stop bit is checked. c. status check. rdrf must be 0 so that receive data can be loaded from the rsr into the rdr. if the data passes these checks, the sci sets rdrf to 1 and stores the received data in the rdr. if one of the checks fails (receive error), the sci operates as indicated in table 13.11. note: when a receive error occurs, further receiving is disabled. while receiving, the rdrf bit is not set to 1, so be sure to clear the error flags. 4. after setting rdrf to 1, if the receive-data-full interrupt enable bit (rie) is set to 1 in the scr, the sci requests a receive-data-full interrupt (rxi). if one of the error flags (orer, per, or fer) is set to 1 and the receive-data-full interrupt enable bit (rie) in the scr is also set to 1, the sci requests a receive-error interrupt (eri). figure 13.9 shows an example of sci receive operation in the asynchronous mode. table 13.11 receive error conditions and sci operation receive error abbreviation condition data transfer overrun error orer receiving of next data ends while rdrf is still set to 1 in ssr receive data not loaded from rsr into rdr framing error fer stop bit is 0 receive data loaded from rsr into rdr parity error per parity of receive data differs from even/odd parity setting in smr receive data loaded from rsr into rdr
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 406 of 818 rej09b0273-0500 tdrf fer framing error generates eri interrupt request. 1 frame rxi interrupt handler reads data in rdr and clears rdrf to 0. 01 1 1 0/1 0 1 parity bit parity bit serial data start bit data stop bit start bit data stop bit idle (marking state) d0 d1 d7 d0 d1 d7 0/1 rxi interrupt request example: 8-bit data with parity and one stop bit figure 13.9 sci receive operation 13.3.3 multiprocessor communication the multiprocessor communication function enables several processors to share a single serial communication line for sending and receiving data. the processors communicate in the asynchronous mode using a format with an additional multiprocessor bit (multiprocessor format). in multiprocessor communication, each receiving processor is addressed by a unique id. a serial communication cycle consists of an id-sending cycle that identifies the receiving processor, and a data-sending cycle. the multiprocessor bit distinguishes id-sending cycles from data-sending cycles. the transmitting processor starts by sending the id of the receiving processor with which it wants to communicate as data with the multiprocessor bit set to 1. next the transmitting processor sends transmit data with the multiprocessor bit cleared to 0. receiving processors skip incoming data until they receive data with the multiprocessor bit set to 1. when they receive data with the multiprocessor bit set to 1, receiving processors compare the data with their ids. the receiving processor with a matching id continues to receive further incoming data. processors with ids not matching the received data skip further incoming data until they again receive data with the multiprocessor bit set to 1. multiple processors can send and receive data in this way. figure 13.10 shows the example of communication among processors using the multiprocessor format.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 407 of 818 rej09b0273-0500 communication formats: four formats are available. parity-bit settings are ignored when the multiprocessor format is selected. for details see table 13.9. clock: see the description in the asynchronous mode section. receiving processor a (id = 01) (id = 02) (id = 03) (id = 04) receiving processor b receiving processor c serial communication line h'01 h'aa (mpb = 0) (mpb = 1) id-transmit cycle: receiving processor address serial data mpb: multiprocessor bit example: sending data h'aa to receiving processor a transmitting processor receiving processor d data-transmit cycle: data sent to receiving processor specified by id figure 13.10 communication among processors using multiprocessor format transmitting multiprocessor serial data: figure 13.11 shows a sample flowchart for transmitting multiprocessor serial data. the procedure is as follows (the steps correspond to the numbers in the flowchart): 1. sci initialization: set the txd pin using the pfc. 2. sci status check and transmit data write: read the serial status register (ssr), check that the tdre bit is 1, then write transmit data in the transmit data register (tdr). also set mpbt (multiprocessor bit transfer) to 0 or 1 in ssr. finally, clear tdre to 0. 3. continue transmitting serial data: read the tdre bit to check whether it is safe to write (if it reads 1); if so, write data in tdr, then clear tdre to 0. when the dmac is started by a transmit-data-empty interrupt request (txi) to write data in tdr, the tdre bit is checked and cleared automatically.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 408 of 818 rej09b0273-0500 4. output a break at the end of serial transmission: set the data register (dr) of the port to 0, then clear te to 0 in scr and set the txd pin function as output port with the pfc. tdre = 1? write transmit data in tdr and set mpbt in ssr all data transmitted? yes tend = 1? read tend bit in ssr output break signal? yes set dr = 0 clear te bit in scr to 0; select thetxd pin function as an output port with the pfc end transmission yes read tdre bit in ssr clear tdre bit to 0 initialization no no yes no no 1 2 3 4 start transmission figure 13.11 sample flowchart for transmitting multiprocessor serial data
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 409 of 818 rej09b0273-0500 in transmitting serial data, the sci operates as follows: 1. the sci monitors the tdre bit in the ssr. when tdre is cleared to 0 the sci recognizes that the transmit data register (tdr) contains new data, and loads this data from the tdr into the transmit shift register (tsr). 2. after loading the data from the tdr into the tsr, the sci sets the tdre bit to 1 and starts transmitting. if the transmit-data-empty interrupt enable bit (tie) in the scr is set to 1, the sci requests a transmit-data-empty interrupt (txi) at this time. serial transmit data is transmitted in the following order from the txd pin: a. start bit: one 0 bit is output. b. transmit data: seven or eight bits are output, lsb first. c. multiprocessor bit: one multiprocessor bit (mpbt value) is output. d. stop bit: one or two 1 bits (stop bits) are output. e. marking: output of 1 bits continues until the start bit of the next transmit data. 3. the sci checks the tdre bit when it outputs the stop bit. if tdre is 0, the sci loads data from the tdr into the tsr, outputs the stop bit, then begins serial transmission of the next frame. if tdre is 1, the sci sets the tend bit in the ssr to 1, outputs the stop bit, then continues output of 1 bits in the marking state. if the transmit-end interrupt enable bit (teie) in the scr is set to 1, a transmit-end interrupt (tei) is requested at this time. figure 13.12 shows an example of sci receive operation in the multiprocessor format.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 410 of 818 rej09b0273-0500 tdre tend txi interrupt handler writes data in tdr and clears tdre to 0 txi interrupt request tei interrupt request 1 frame 01 1 1 0/1 0 1 multiprocessor bit multiprocessor bit serial data start bit data stop bit start bit data stop bit idle (marking state) d0 d1 d7 d0 d1 d7 0/1 example: 8-bit data with multiprocessor bit and one stop bit txi interrupt request figure 13.12 sci multiprocessor transmit operation receiving multiprocessor serial data: figure 13.13 shows a sample flowchart for receiving multiprocessor serial data. the procedure for receiving multiprocessor serial data is listed below. 1. sci initialization: set the rxd pin using the pfc. 2. id receive cycle: set the mpie bit in the serial control register (scr) to 1. 3. sci status check and compare to id reception: read the serial status register (ssr), check that rdrf is set to 1, then read data from the receive data register (rdr) and compare with the processor?s own id. if the id does not match the receive data, set mpie to 1 again and clear rdrf to 0. if the id matches the receive data, clear rdrf to 0. 4. receive error handling and break detection: if a receive error occurs, read the orer and fer bits in ssr to identify the error. after executing the necessary error processing, clear both orer and fer to 0. receiving cannot resume if orer or fer remain set to 1. when a framing error occurs, the rxd pin can be read to detect the break state. 5. sci status check and data receiving: read ssr, check that rdrf is set to 1, then read data from the receive data register (rdr).
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 411 of 818 rej09b0273-0500 rdrf = 1? fer = 1? or orer =1? rdrf = 1? all data received? no end reception yes set mpie bit in scr to 1 read rdrf bit of ssr initialization clear re bit in scr to 0 yes no 1 2 3 read orer and fer bits of ssr fer = 1? or orer =1? read rdrf bit in ssr read receive data from rdr is id the station ? s id no read orer and fer bits in ssr read receive data from rdr no error processing no yes 5 4 yes yes no yes start reception figure 13.13 sample flowchart for receiving multiprocessor serial data
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 412 of 818 rej09b0273-0500 orer = 1? break? yes framing error handling yes start error handling overrun error handling yes fer = 1? clear orer and fer bits in ssr to 0 end no no no clear re bit in scr to 0 figure 13.13 sample flowchart for receiving multiprocessor serial data (cont)
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 413 of 818 rej09b0273-0500 figures 13.14 and 13.15 show examples of sci receive operation using a multiprocessor format. rdrf mpie rdr value id1 rxi interrupt request (multiprocessor interrupt), mpie = 0 rxi interrupt handler reads data in rdr and clears rdrf to 0 not station ? s id, so mpie is set to 1 again no rxi interrupt, rdr maintains state 01 1 1 10 1 serial data start bit stop bit start bit stop bit idling (marking) d0 d1 d7 d0 d1 d7 0 mpb mpb mpb data (id1) data (data 1) figure 13.14 sci receive operation (id does not match)
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 414 of 818 rej09b0273-0500 rdrf mpie rdr value id1 id2 01 1 1 10 1 mpb mpb serial data start bit data (id2) data (data 2) stop bit start bit stop bit idling (marking) d0 d1 d7 d0 d1 d7 0 rxi interrupt request (multiprocessor interrupt), mpie = 0 rxi interrupt handler reads data in rdr and clears rdrf to 0 station ? s id, so receiving continues, with data received by the rxi interrupt processing routine mpie bit is again set to 1 mpb data2 example: own id matches data, 8-bit data with multiprocessor bit and one stop bit figure 13.15 example of sci receive operation (id matches) 13.3.4 clock synchronous operation in the clock synchronous mode, the sci transmits and receives data in synchronization with clock pulses. this mode is suitable for high-speed serial communication. the sci transmitter and receiver are independent, so full duplex communication is possible while sharing the same clock. the transmitter and receiver are also double buffered, so continuous transmitting or receiving is possible by reading or writing data while transmitting or receiving is in progress. figure 13.16 shows the general format in clock synchronous serial communication.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 415 of 818 rej09b0273-0500 bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 lsb msb synchroni- zation clock serial data * * transfer direction one unit (character or frame) of communication data note: * high except in continuous transmitting or receiving. figure 13.16 data format in clock synchronous communication in clock synchronous serial communication, each data bit is output on the communication line from one falling edge of the serial clock to the next. data are guaranteed valid at the rising edge of the serial clock. in each character, the serial data bits are transmitted in order from the lsb (first) to the msb (last). after output of the msb, the communication line remains in the state of the msb. in the clock synchronous mode, the sci transmits or receives data by synchronizing with the falling edge of the synchronization clock. communication format: the data length is fixed at eight bits. no parity bit or multiprocessor bit can be added. clock: an internal clock generated by the on-chip baud rate generator or an external clock input from the sck pin can be selected as the sci transmit/receive clock. the clock source is selected by the c/ a bit in the serial mode register (smr) and bits cke1 and cke0 in the serial control register (scr). see table 13.9. when the sci operates on an internal clock, it outputs the clock signal at the sck pin. eight clock pulses are output per transmitted or received character. when the sci is not transmitting or receiving, the clock signal remains in the high state. note: an overrun error occurs only during the receive operation, and the sync clock is output until the re bit is cleared to 0. when you want to perform a receive operation in one- character units, select external clock for the clock source. sci initialization (clock synchronous mode): before transmitting or receiving, software must clear the te and re bits to 0 in the serial control register (scr), then initialize the sci as follows. when changing the mode or communication format, always clear the te and re bits to 0 before following the procedure given below. clearing te to 0 sets tdre to 1 and initializes the transmit
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 416 of 818 rej09b0273-0500 shift register (tsr). clearing re to 0, however, does not initialize the rdrf, per, fer, and orer flags and receive data register (rdr), which retain their previous contents. figure 13.17 is a sample flowchart for initializing the sci. 1. write the value corresponding to the bit rate in the bit rate register (brr) unless an external clock is used. 2. select the clock source in the serial control register (scr). leave rie, tie, teie, mpie, te, and re cleared to 0. 3. select the communication format in the serial mode register (smr). 4. wait for at least the interval required to transmit or receive one bit, then set te or re in the serial control register (scr) to 1. when selecting the simultaneous transmission and receiving, set te and re bits to 1 simultaneously. also set rie, tie, teie, and mpie. the txd, rxd pins becomes usable in response to the pfc corresponding bits and the te, re bit settings. start of initialization clear te and re bits to 0 in scr 1-bit interval elapsed? set te and re to 1 in scr; set rie, tie, teie, and mpie bits yes no 1 set rie, tie, teie, mpie, cke1, and cke0 bits in scr (te and re are 0) end wait select transmit/receive format in smr set value in brr 2 3 4 figure 13.17 sample flowchart for sci initialization
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 417 of 818 rej09b0273-0500 transmitting serial data (synchronous mode): figure 13.18 shows a sample flowchart for transmitting serial data and indicates the procedure to follow. 1. sci initialization: set the txd pin function with the pfc. 2. sci status check and transmit data write: read ssr, check that the tdre flag is 1, then write transmit data in tdr and clear the tdre flag to 0. 3. to continue transmitting serial data: after checking that the tdre flag is 1, indicating that data can be written, write data in tdr, then clear the tdre flag to 0. when the dmac is activated by a transmit-data-empty interrupt request (txi) to write data in tdr, the tdre flag is checked and cleared automatically.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 418 of 818 rej09b0273-0500 start transmitting read tdre flag in ssr tdre = 1? write transmit data in tdr and clear tdre flag to 0 in ssr all data transmitted? read tend flag in ssr yes no no no yes tend = 1? yes end clear te bit to 0 in scr initialize 2 3 1 figure 13.18 sample flowchart for serial transmitting
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 419 of 818 rej09b0273-0500 figure 13.19 shows an example of sci transmit operation. bit 0 bit 1 bit 7 bit 0 bit 1 bit 6 synchroni- zation clock serial data transmit direction bit 7 txi interrupt handler writes data in tdr and clears tdre to 0 1 frame txi request txi request tdre tend lsb msb tei request figure 13.19 example of sci transmit operation sci serial transmission operates as follows. 1. the sci monitors the tdre bit in the ssr. when tdre is cleared to 0 the sci recognizes that the transmit data register (tdr) contains new data and loads this data from the tdr into the transmit shift register (tsr). 2. after loading the data from the tdr into the tsr, the sci sets the tdre bit to 1 and starts transmitting. if the transmit-data-empty interrupt enable bit (tie) in the scr is set to 1, the sci requests a transmit-data-empty interrupt (txi) at this time. if clock output mode is selected, the sci outputs eight synchronous clock pulses. if an external clock source is selected, the sci outputs data in synchronization with the input clock. data are output from the txd pin in order from the lsb (bit 0) to the msb (bit 7). 3. the sci checks the tdre bit when it outputs the msb (bit 7). if tdre is 0, the sci loads data from the tdr into the tsr, then begins serial transmission of the next frame. if tdre is 1, the sci sets the tend bit in the ssr to 1, transmits the msb, then holds the transmit data pin (txd) in the msb state. if the transmit-end interrupt enable bit (teie) in the scr is set to 1, a transmit-end interrupt (tei) is requested at this time. 4. after the end of serial transmission, the sck pin is held in the high state.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 420 of 818 rej09b0273-0500 receiving serial data (clock synchronous mode): figure 13.20 shows a sample flowchart for receiving serial data. when switching from the asynchronous mode to the clock synchronous mode, make sure that orer, per, and fer are cleared to 0. if per or fer is set to 1, the rdrf bit will not be set and both transmitting and receiving will be disabled. the procedure for receiving serial data is listed below: 1. sci initialization: set the rxd pin using the pfc. 2. receive error handling: if a receive error occurs, read the orer bit in ssr to identify the error. after executing the necessary error handling, clear orer to 0. transmitting/receiving cannot resume if orer remains set to 1. 3. sci status check and receive data read: read the serial status register (ssr), check that rdrf is set to 1, then read receive data from the receive data register (rdr) and clear rdrf to 0. the rxi interrupt can also be used to determine if the rdrf bit has changed from 0 to 1. 4. continue receiving serial data: read rdr, and clear rdrf to 0 before the frame msb (bit 7) of the current frame is received. if the dmac is started by a receive-data-full interrupt (rxi) to read rdr, the rdrf bit is cleared automatically so this step is unnecessary.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 421 of 818 rej09b0273-0500 start reception initialization read the orer bit of ssr all data received? end reception 1 no yes orer = 1? read receive data from rdr and clear rdrf bit of ssr to 0 rdrf = 1? yes yes no clear re bit of scr to 0 no read rdrf bit of ssr error processing 3 4 2 figure 13.20 sample flowchart for serial receiving
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 422 of 818 rej09b0273-0500 error handling end clear orer bit of ssr to 0 overrun error processing figure 13.20 sample flowchart for serial receiving (cont) figure 13.21 shows an example of the sci receive operation. bit 7 bit 0 bit 7 bit 0 bit 1 bit 6 synchroni- zation clock serial data transfer direction bit 7 read data with rxi interrupt processing routine and clear rdrf bit to 0 1 frame rxi request rxi request eri interrupt request generated by overrun error rdrf orer figure 13.21 example of sci receive operation in receiving, the sci operates as follows: 1. the sci synchronizes with serial clock input or output and initializes internally. 2. receive data is shifted into the rsr in order from the lsb to the msb. after receiving the data, the sci checks that rdrf is 0 so that receive data can be loaded from the rsr into the
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 423 of 818 rej09b0273-0500 rdr. if this check passes, the sci sets rdrf to 1 and stores the received data in the rdr. if the check does not pass (receive error), the sci operates as indicated in table 13.11 and no further transmission or reception is possible. if the error flag is set to 1, the rdrf bit is not set to 1 during reception, even if the rdrf bit is 0 cleared. when restarting reception, be sure to clear the error flag. 3. after setting rdrf to 1, if the receive-data-full interrupt enable bit (rie) is set to 1 in the scr, the sci requests a receive-data-full interrupt (rxi). if the orer bit is set to 1 and the receive-data-full interrupt enable bit (rie) in the scr is also set to 1, the sci requests a receive-error interrupt (eri). transmitting and receiving serial data simultaneously (clock synchronous mode): figure 13.22 shows a sample flowchart for transmitting and receiving serial data simultaneously. the procedure is as follows (the steps correspond to the numbers in the flowchart): 1. sci initialization: set the txd and rxd pins using the pfc. 2. sci status check and transmit data write: read the serial status register (ssr), check that the tdre bit is 1, then write transmit data in the transmit data register (tdr) and clear tdre to 0. the txi interrupt can also be used to determine if the tdre bit has changed from 0 to 1. 3. receive error handling: if a receive error occurs, read the orer bit in ssr to identify the error. after executing the necessary error processing, clear orer to 0. transmitting/receiving cannot resume if orer remains set to 1. 4. sci status check and receive data read: read the serial status register (ssr), check that rdrf is set to 1, then read receive data from the receive data register (rdr) and clear rdrf to 0. the rxi interrupt can also be used to determine if the rdrf bit has changed from 0 to 1. 5. continue transmitting and receiving serial data: read the rdrf bit and rdr, and clear rdrf to 0 before the frame msb (bit 7) of the current frame is received. also read the tdre bit to check whether it is safe to write (if it reads 1); if so, write data in tdr, then clear tdre to 0 before the msb (bit 7) of the current frame is transmitted. when the dmac or the dtc is started by a transmit-data-empty interrupt request (txi) to write data in tdr, the tdre bit is checked and cleared automatically. when the dmac is started by a receive-data-full interrupt (rxi) to read rdr, the rdrf bit is cleared automatically. note: when selecting the transmission or receiving mode to the simultaneous transmission and receiving mode, clear te and re bits to zero once, then set both of them to 1 simultaneously.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 424 of 818 rej09b0273-0500 start transmitting/receive initialization read tdre bit in ssr all data transmitted/and received end transmission/reception 1 2 no yes tdre = 1? write transmission data in tdr and clear tdre bit of ssr to 0 rdrf = 1? yes no clear te and re bits of scr to 0 yes no read orer bit of ssr error handling 3 orer = 1? yes read receive data of rdr, and clear rdrf bit of ssr to 0 read rdrf bit of ssr 4 5 no figure 13.22 sample flowchart for serial transmission
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 425 of 818 rej09b0273-0500 13.4 sci interrupt sources and the dmac the sci has four interrupt sources: transmit-end (tei), receive-error (eri), receive-data-full (rxi), and transmit-data-empty (txi). table 13.12 lists the interrupt sources and indicates their priority. these interrupts can be enabled and disabled by the tie, rie, and teie bits in the serial control register (scr). each interrupt request is sent separately to the interrupt controller. txi is requested when the tdre bit in the ssr is set to 1. txi can start the direct memory access controller (dmac) to transfer data. tdre is automatically cleared to 0 when the dmac writes data in the transmit data register (tdr). rxi is requested when the rdrf bit in the ssr is set to 1. rxi can start the dmac to transfer data. rdrf is automatically cleared to 0 when the dmac reads the receive data register (rdr). eri is requested when the orer, per, or fer bit in the ssr is set to 1. eri cannot start the dmac. tei is requested when the tend bit in the ssr is set to 1. tei cannot start the dmac. where the txi interrupt indicates that transmit data writing is enabled, the tei interrupt indicates that the transmit operation is complete. table 13.12 sci interrupt sources interrupt source description dmac activation priority eri receive error (orer, per, or fer) no high rxi receive data full (rdrf) yes txi transmit data empty (tdre) yes tei transmit end (tend) no low
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 426 of 818 rej09b0273-0500 13.5 notes on use sections 13.5.1 through 13.5.9 provide information for using the sci. 13.5.1 tdr write and tdre flags the tdre bit in the serial status register (ssr) is a status flag indicating loading of transmit data from tdr into tsr. the sci sets tdre to 1 when it transfers data from tdr to tsr. data can be written to tdr regardless of the tdre bit status. if new data is written in tdr when tdre is 0, however, the old data stored in tdr will be lost because the data has not yet been transferred to the tsr. before writing transmit data to the tdr, be sure to check that tdre is set to 1. 13.5.2 simultaneous multiple receive errors table 13.13 indicates the state of the ssr status flags when multiple receive errors occur simultaneously. when an overrun error occurs, the rsr contents cannot be transferred to the rdr, so receive data is lost. table 13.13 ssr status flags and transfer of receive data ssr status flags receive error status rdrf orer fer per receive data transfer rsr rdr overrun error 1 1 0 0 x framing error 0 0 1 0 o parity error 0 0 0 1 o overrun error + framing error 1 1 1 0 x overrun error + parity error 1 1 0 1 x framing error + parity error 0 0 1 1 o overrun error + framing error + parity error 1111x note: o = receive data is transferred from rsr to rdr. x = receive data is not transferred from rsr to rdr.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 427 of 818 rej09b0273-0500 13.5.3 break detection and processing break signals can be detected by reading the rxd pin directly when a framing error (fer) is detected. in the break state, the input from the rxd pin consists of all 0s, so fer is set and the parity error flag (per) may also be set. in the break state, the sci receiver continues to operate, so if the fer bit is cleared to 0, it will be set to 1 again. 13.5.4 sending a break signal the txd pin becomes a general i/o pin with the i/o direction and level determined by the i/o port data register (dr) and pin function controller (pfc) control register (cr). these conditions allow break signals to be sent. the dr value is substituted for the marking status until the pfc is set. consequently, the output port is set to initially output a 1. to send a break in serial transmission, first clear the dr to 0, then establish the txd pin as an output port using the pfc. when te is cleared to 0, the transmission section is initialized regardless of the present transmission status. 13.5.5 receive error flags and transmitter operation (clock synchronous mode only) when a receive error flag (orer, per, or fer) is set to 1, the sci will not start transmitting even if tdre is set to 1. be sure to clear the receive error flags to 0 before starting to transmit. note that clearing re to 0 does not clear the receive error flags. 13.5.6 receive data sampling timing and receive margin in the asynchronous mode in the asynchronous mode, the sci operates on a base clock of 16 times the bit rate frequency. in receiving, the sci synchronizes internally with the falling edge of the start bit, which it samples on the base clock. receive data is latched on the rising edge of the eighth base clock pulse (figure 13.23).
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 428 of 818 rej09b0273-0500 078150781505 internal base clock receive data (rxd) synchronization sampling timing data sampling timing 8 clocks 16 clocks start bit ? 7.5 clocks +7.5 clocks d0 d1 figure 13.23 receive data sampling timing in asynchronous mode the receive margin in the asynchronous mode can therefore be expressed as: m = 0.5 ? 1 2n d ? 0.5 n ? (l ? 0.5) f ? (1 + f) 100% () m : receive margin (%) n : ratio of clock frequency to bit rate (n = 16) d : clock duty cycle (d = 0 ? 1.0) l : frame length (l = 9 ? 12) f : absolute deviation of clock frequency from the equation above, if f = 0 and d = 0.5 the receive margin is 46.875%: d = 0.5, f = 0 m = (0.5 ? 1/(2 16)) 100% = 46.875% this is a theoretical value. a reasonable margin to allow in system designs is 20 ? 30%.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 429 of 818 rej09b0273-0500 13.5.7 constraints on dmac use ? when using an external clock source for the synchronization clock, update the tdr with the dmac, and then after five system clocks or more elapse, input a transmit clock. if a transmit clock is input in the first four system clocks after the tdr is written, an error may occur (figure 13.24). ? before reading the receive data register (rdr) with the dmac, select the receive-data-full interrupt of the sci as a start-up source. d0 d1 d2 d3 d4 d5 d6 d7 sck tdre t note: during external clock operation, an error may occur if t is 4 or less. figure 13.24 example of clock synchronous transmission with dmac 13.5.8 cautions for clock synchronous external clock mode ? set te = re = 1 only when the external clock sck is 1. ? do not set te = re = 1 until at least four clocks after the external clock sck has changed from 0 to 1. ? when receiving, rdrf is 1 when re is set to zero 2.5 ? 3.5 clocks after the rising edge of the rxd d7 bit sck input, but it cannot be copied to rdr. 13.5.9 caution for clock synchronous internal clock mode when receiving, rdrf is 1 when re is set to zero 1.5 clocks after the rising edge of the rxd d7 bit sck output, but it cannot be copied to rdr.
section 13 serial communication interface (sci) rev. 5.00 jan 06, 2006 page 430 of 818 rej09b0273-0500
section 14 a/d converter rev. 5.00 jan 06, 2006 page 431 of 818 rej09b0273-0500 section 14 a/d converter 14.1 overview the sh7050 series includes a 10-bit successive-approximation a/d converter., with software selection of up to 16 analog input channels. the a/d converter is composed of two independent modules, a/d0 and a/d1. a/d0 comprises three groups, while a/d1 comprises a single group. module analog groups channels a/d0 analog group 0 an0?an3 analog group 1 an4?an7 analog group 2 an8?an11 a/d1 analog group 3 an12?an15 14.1.1 features the features of the a/d converter are summarized below. ? 10-bit resolution 16 input channels (a/d0: 12 channels, a/d1: 4 channels) ? high-speed conversion conversion time: minimum 6.7 s per channel (when = 20 mhz) ? two conversion modes ? single mode: a/d conversion on one channel ? scan mode: continuous conversion on 1 to 12 channels (a/d0) continuous conversion on 1 to 4 channels (a/d1) ? sixteen 10-bit a/d data registers a/d conversion results are transferred for storage into data registers corresponding to the channels. ? two sample-and-hold circuits a sample-and-hold circuit is built into each a/d converter module (ad/0 and ad/1), simplifying the configuration of external analog input circuitry.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 432 of 818 rej09b0273-0500 ? a/d conversion interrupts and dma function supported an a/d conversion interrupt request (adi) can be sent to the cpu at the end of a/d conversion (adi0: a/d0 interrupt request; adi1: a/d1 interrupt request). also, the dmac can be activated by an adi interrupt request. ? two kinds of conversion activation ? software or external trigger (pin, atu) can be selected (a/d0) ? software or external trigger (pin) can be selected (a/d1) ? analog conversion voltage range can be set the analog conversion voltage range can be set with the av ref pin. ? adend output conversion timing can be monitored with the adend output pin when using channel 15 in scan mode. 14.1.2 block diagram figure 14.1 shows a block diagram of the a/d converter.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 433 of 818 rej09b0273-0500 a/d0 a/d1 10-bit d/a addr0 ? 11 successive- approximation register bus interface analog multiplexer adcsr0 adcr0 adtrgr an0 an1 an2 an3 an4 an5 an6 an7 an8 an9 an10 an11 + ? comparator sample-and- hold circuit a/d conversion control circuit av cc av ss av ref addr 12 ? 15 adcsr1 adcr1 an12 adend an15 an14 an13 module data bus internal data bus adi0 interrupt signal atu trigger adtrg legend: adcr0, adcr1: a/d control registers 0 and 1 adcsr0, adcsr1: a/d control/status registers 0 and 1 addr0 to addr15: a/d data registers 0 to 15 adtrgr: a/d trigger register module data bus bus interface internal data bus adi1 interrupt signal a/d conversion control circuit comparator + ? analog multiplexer sample-and- hold circuit 10-bit d/a successive- approximation register figure 14.1 a/d converter block diagram
section 14 a/d converter rev. 5.00 jan 06, 2006 page 434 of 818 rej09b0273-0500 14.1.3 pin configuration table 14.1 summarizes the a/d converter?s input pins. there are 16 analog input pins, an0 to an15. the 12 pins an0 to an11 are a/d0 analog inputs, divided into three groups: an0 to an3 (group 0), an4 to an7 (group 1), and an8 to an11 (group 2). the four pins an12 to an15 are a/d1 analog inputs, comprising analog input group 3. the adtrg pin is used to provide a/d conversion start timing from off-chip. when a low-level pulse is applied to this pin, the a/d converter starts conversion. this pin is shared by a/d0 and a/d1. the adend pin is an output used to monitor conversion timing when channel 15 is used in scan mode. the av cc and av ss pins are power supply voltage pins for the analog section in the a/d converter. the av ref pin is the a/d converter reference voltage pin. these pins are also shared by a/d0 and a/d1. to maintain chip reliability, ensure that av cc = v cc 10% and av ss = v ss during normal operation, and never leave the av cc and av ss pins open, even when the a/d converter is not being used. the voltage applied to the analog input pins should be in the range av ss ann av ref .
section 14 a/d converter rev. 5.00 jan 06, 2006 page 435 of 818 rej09b0273-0500 table 14.1 a/d converter pins pin name abbreviation i/o function analog power supply pin av cc input analog section power supply analog ground pin av ss input analog section ground and reference voltage analog reference power supply pin av ref input analog section reference voltage analog input pin 0 an0 input a/d0 analog inputs 0 to 3 (analog group 0) analog input pin 1 an1 input analog input pin 2 an2 input analog input pin 3 an3 input analog input pin 4 an4 input a/d0 analog inputs 4 to 7 (analog group 1) analog input pin 5 an5 input analog input pin 6 an6 input analog input pin 7 an7 input analog input pin 8 an8 input a/d0 analog inputs 8 to 11 (analog group 2) analog input pin 9 an9 input analog input pin 10 an10 input analog input pin 11 an11 input analog input pin 12 an12 input a/d1 analog inputs 12 to 15 (analog group 3) analog input pin 13 an13 input analog input pin 14 an14 input analog input pin 15 an15 input a/d conversion trigger input pin adtrg input a/d conversion trigger input adend output pin adend output a/d1 channel 15 conversion timing monitor output
section 14 a/d converter rev. 5.00 jan 06, 2006 page 436 of 818 rej09b0273-0500 14.1.4 register configuration table 14.2 summarizes the a/d converter?s registers. table 14.2 a/d converter registers name abbreviation r/w initial value address access size * 1 a/d data register 0 (h/l) addr0 (h/l) r h'0000 h'ffff85d0 8, 16 a/d data register 1 (h/l) addr1 (h/l) r h'0000 h'ffff85d2 8, 16 a/d data register 2 (h/l) addr2 (h/l) r h'0000 h'ffff85d4 8, 16 a/d data register 3 (h/l) addr3 (h/l) r h'0000 h'ffff85d6 8, 16 a/d data register 4 (h/l) addr4 (h/l) r h'0000 h'ffff85d8 8, 16 a/d data register 5 (h/l) addr5 (h/l) r h'0000 h'ffff85da 8, 16 a/d data register 6 (h/l) addr6 (h/l) r h'0000 h'ffff85dc 8, 16 a/d data register 7 (h/l) addr7 (h/l) r h'0000 h'ffff85de 8, 16 a/d data register 8 (h/l) addr8 (h/l) r h'0000 h'ffff85e0 8, 16 a/d data register 9 (h/l) addr9 (h/l) r h'0000 h'ffff85e2 8, 16 a/d data register 10 (h/l) addr10 (h/l) r h'0000 h'ffff85e4 8, 16 a/d data register 11 (h/l) addr11 (h/l) r h'0000 h'ffff85e6 8, 16 a/d data register 12 (h/l) addr12 (h/l) r h'0000 h'ffff85f0 8, 16 a/d data register 13 (h/l) addr13 (h/l) r h'0000 h'ffff85f2 8, 16 a/d data register 14 (h/l) addr14 (h/l) r h'0000 h'ffff85f4 8, 16 a/d data register 15 (h/l) addr15 (h/l) r h'0000 h'ffff85f6 8, 16 a/d control/status register 0 adcsr0 r/(w) * 2 h'00 h'ffff85e8 8, 16 a/d control register 0 adcr0 r/w h'1f h'ffff85e9 8, 16 a/d control/status register 1 adcsr1 r/(w) * 2 h'00 h'ffff85f8 8, 16 a/d control register 1 adcr1 r/w h'7f h'ffff85f9 8, 16 a/d trigger register adtrgr r/w h'ff h'ffff83b8 8 notes: register accesses consist of 3 cycles for byte access and 6 cycles for word access. 1. a 16-bit access must be made on a word boundary. 2. only 0 can be written in bit 7, to clear the flag.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 437 of 818 rej09b0273-0500 14.2 register descriptions 14.2.1 a/d data registers 0 to 15 (addr0 to addr15) a/d data registers 0 to 15 (addr0 to addr15) are 16-bit read-only registers that store the results of a/d conversion. there are 16 registers, corresponding to analog inputs 0 to 15 (an0 to an15). the addr registers are initialized to h'0000 by a power-on reset, and in hardware standby mode and software standby mode. bit:76543210 addrnh (upper byte) ad9 ad8 ad7 ad6 ad5 adr ad3 ad2 initial value:00000000 r/w:rrrrrrrr bit:76543210 addrnl (lower byte) ad1 ad0 ?????? initial value:00000000 r/w:rrrrrrrr (n = 0 to 15) the a/d converter converts analog input to a 10-bit digital value. the upper 8 bits of this data are stored in the upper byte of the addr corresponding to the selected channel, and the lower 2 bits in the lower byte of that addr. only the most significant 2 bits of the addr lower byte data are valid. table 14.3 shows correspondence between the analog input channels and a/d data registers.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 438 of 818 rej09b0273-0500 table 14.3 analog input channels and a/d data registers analog input channel a/d data register analog input channel a/d data register analog input channel a/d data register analog input channel a/d data register an0 addr0 an4 addr4 an8 addr8 an12 addr12 an1 addr1 an5 addr5 an9 addr9 an13 addr13 an2 addr2 an6 addr6 an10 addr10 an14 addr14 an3 addr3 an7 addr7 an11 addr11 an15 addr15 14.2.2 a/d control/status register 0 (adcsr0) a/d control/status register 0 (adcsr0) is an 8-bit readable/writable register whose functions include selection of the a/d conversion mode for a/d0. adcsr0 is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode. bit:76543210 adf adie adm1 adm0 ch3 ch2 ch1 ch0 initial value:00000000 r/w: r/(w) * r/w r/w r/w r/w r/w r/w r/w note: * only 0 can be written, to clear the flag. bit 7?a/d end flag (adf): indicates the end of a/d conversion. bit 7: adf description 0 indicates that a/d0 is performing a/d conversion, or is in the idle state. [clearing conditions] ? when adf is read while set to 1, then 0 is written in adf ? when the dmac is activated by adi0 (initial value) 1 indicates that a/d0 has finished a/d conversion, and the digital value has been transferred to addr. [setting conditions] ? single mode: when a/d conversion ends ? scan mode: when all a/d conversions end within one selected analog group
section 14 a/d converter rev. 5.00 jan 06, 2006 page 439 of 818 rej09b0273-0500 the operation of the a/d converter after adf is set to 1 differs between single mode and scan mode. in single mode, after the a/d converter transfers the digit value to addr, adf is set to 1 and the a/d converter enters the idle state. in scan mode, after all conversions end within one selected analog group, adf is set to 1 and conversion is continued. for example, in the case of 12-channel scanning, adf is set to 1 immediately after the end of conversion for an0 to an3 (group 0) it is not possible to write 1 to adf. bit 6?a/d interrupt enable (adie): enables or disables the a/d interrupt (adi). to prevent incorrect operation, ensure that the adst bit in a/d control register 0 (adcr0) is cleared to 0 before switching the operating mode. bit 6: adie description 0 a/d interrupt (adi0) is disabled (initial value) 1 a/d interrupt (adi0) is enabled when a/d conversion ends and the adf bit in adcsr0 is set to 1, an a/d0 a/d interrupt (adi0) will be generated if the adie bit is 1. adi0 is cleared by clearing adf or adie to 0. bits 5 and 4: a/d mode 1 and 0 (adm1, adm0): these bits select the a/d conversion mode from single mode, 4-channel scan mode, 8-channel scan mode, and 12-channel scan mode. to prevent incorrect operation, ensure that the adst bit in a/d control register 0 (adcr0) is cleared to 0 before switching the operating mode. bit 5: adm1 bit 4: adm0 description 0 0 single mode (initial value) 1 4-channel scan mode (analog group 0/1/2) 1 0 8-channel scan mode (analog groups 0 and 1) 1 12-channel scan mode (analog groups 0, 1, and 2)
section 14 a/d converter rev. 5.00 jan 06, 2006 page 440 of 818 rej09b0273-0500 when adm1 and adm0 are set to 00, single mode is set. in single mode, operation ends after a/d conversion has been performed once on the analog channels selected with bits ch3 to ch0 in adcsr. when adm1 and adm0 are set to 01, 4-channel scan mode is set. in scan mode, a/d conversion is performed continuously on a number of channels. the channels on which a/d conversion is to be performed in scan mode are set with bits ch3 to ch0 in adcsr0. in 4-channel scan mode, conversion is performed continuously on the channels in one of analog groups 0 (an0 to an3), 1 (an4 to an7), or 2 (an8 to an11). when adm1 and adm0 are set to 10, 8-channel scan mode is set. in 8-channel scan mode, conversion is performed continuously on the 8 channels in analog groups 0 (an0 to an3) and 1 (an4 to an7) when adm1 and adm0 are set to 11, 12-channel scan mode is set. in 12-channel scan mode, conversion is performed continuously on the 12 channels in analog groups 0 (an0 to an3), 1 (an4 to an7), and 2 (an8 to an11). for details of the operation in single mode and scan mode, see section 14.4, operation. bits 3 to 0?channel select 3 to 0 (ch3 to ch0): these bits, together with the adm1 and adm0 bits, select the analog input channels. to prevent incorrect operation, ensure that the adst bit in a/d control register 0 (adcr0) is cleared to 0 before changing the analog input channel selection.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 441 of 818 rej09b0273-0500 analog input channels bit 3: ch3 bit 2: ch2 bit 1: ch1 bit 0: ch0 single mode 4-channel scan mode 0 0 0 0 an0 (initial value) an0 1 an1 an0, an1 10 an2 an0 ? an2 1an3 an0 ? an3 100 an4 an4 1 an5 an4, an5 10 an6 an4 ? an6 1an7 an4 ? an7 10 * 1 00 an8 an8 1 an9 an8, an9 1 0 an10 an8 ? an10 1 an11 an8 ? an11 analog input channels bit 3: ch3 bit 2: ch2 bit 1: ch1 bit 0: ch0 8-channel scan mode 12-channel scan mode 0 0 0 0 an0, an4 an0, an4, an8 1 an0, an1, an4, an5 an0, an1, an4, an5, an8, an9 10 an0 ? an2, an4 ? an6 an0 ? an2, an4 ? an6, an8 ? an10 1an0 ? an7 an0 ? an11 1 0 0 an0, an4 an0, an4, an8 1 an0, an1, an4, an5 an0, an1, an4, an5, an8, an9 10 an0 ? an2, an4 ? an6 an0 ? an2, an4 ? an6, an8 ? an10 1an0 ? an7 an0 ? an11 10 * 1 00 reserved * 2 an0, an4, an8 1 an0, an1, an4, an5, an8, an9 10 an0 ? an2, an4 ? an6, an8 ? an10 1an0 ? an11 notes: 1. must be cleared to 0. 2. these modes are provided for future expansion, and cannot be used at present.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 442 of 818 rej09b0273-0500 14.2.3 a/d control register 0 (adcr0) a/d control register 0 (adcr0) is an 8-bit readable/writable register that controls the start of a/d conversion and selects the operating clock. adcr0 is initialized to h'1f by a power-on reset, and in hardware standby mode and software standby mode. bits 4 to 0 of adcr0 are reserved. these bits cannot be written to, and always return 1 if read. bit:76543210 trge cks adst ????? initial value:00011111 r/w:r/wr/wr/wrrrrr bit 7?trigger enable (trge): enables or disables triggering of a/d conversion by external input or the atu. bit 7: trge description 0 a/d conversion triggering by external input or atu is disabled (initial value) 1 a/d conversion triggering by external input or atu is enabled for details of external or atu trigger selection, see section 14.2.6, a/d trigger register. when atu triggering is selected, clear bit 7 of the adtrgr register to 0. when external triggering is selected, upon input of a low-level pulse to the adtrg pin after trge has been set to 1, the a/d converter detects the falling edge of the pulse, and sets the adst bit to 1 in adcr. the same operation is subsequently performed when 1 is written in the adst bit by software. external triggering of a/d conversion is only enabled when the adst bit is cleared to 0. when external triggering is used, the low-level pulse input to the adtrg pin must be at least 1.5 clock cycles in width. for details, see section 14.4.4, external triggering of a/d conversion.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 443 of 818 rej09b0273-0500 bit 6?clock select (cks): selects the a/d conversion time. a/d conversion is executed in a maximum of 266 states when cks is 0, and a maximum of 134 states when 1. to prevent incorrect operation, ensure that the adst bit in a/d control register 0 (adcr0) is cleared to 0 before changing the a/d conversion time. for details, see section 14.4.3, analog input setting and a/d conversion time. bit 6: cks description 0 conversion time = 266 states (maximum) (initial value) 1 conversion time = 134 states (maximum) bit 5?a/d start (adst): starts or stops a/d conversion. a/d conversion is started when adst is set to 1, and stopped when adst is cleared to 0. bit 5: adst description 0 a/d conversion is stopped (initial value) 1 a/d conversion is being executed [clearing conditions] ? single mode: automatically cleared to 0 when a/d conversion ends ? scan mode: cleared by writing 0 in adst after confirming that adf in adcsr0 is 1 note that the operation of the adst bit differs between single mode and scan mode. in single mode and scan mode, adst is automatically cleared to 0 when a/d conversion ends on one channel. however, in scan mode, when all conversions have ended for the selected analog inputs, adst remains set to 1 in order to start a/d conversion again for all the channels. therefore, the adst bit must be cleared to 0, stopping a/d conversion, before changing the conversion time or the analog input channel selection. ensure that the adst bit in adcr0 is cleared to 0 before switching the operating mode. also, make sure that a/d conversion is stopped (adst is cleared to 0) before changing a/d interrupt enabling (bit adie in adcsr0), the a/d conversion time (bit cks in adcr0), the operating mode (bits adm1 and adm0 in adscr), or the analog input channel selection (bits ch3 to ch0 in adcsr0). the a/d data register contents will not be guaranteed if these changes are made while the a/d converter is operating (adst is set to 1). bits 4 to 0?reserved: these bits are always read as 1, and should only be written with 1.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 444 of 818 rej09b0273-0500 14.2.4 a/d control/status register 1 (adcsr1) a/d control/status register 0 (adcsr1) is an 8-bit readable/writable register whose functions include selection of the a/d conversion mode for a/d1. adcsr1 is initialized to h'00 by a power-on reset, and in hardware standby mode and software standby mode. bit:76543210 adf adie adst scan cks ? ch1 ch0 initial value:00000000 r/w: r/(w) * r/w r/w r/w r/w r r/w r/w note: * only 0 can be written, to clear the flag. bit 7?a/d end flag (adf): same as adf in adcsr0. bit 6?a/d interrupt enable (adie): same as adie in adcsr0. bit 5?a/d start (adst): same as adst in adcr0. bit 4?scan mode (scan): selects single mode or scan mode for a/d1. to prevent incorrect operation, ensure that the adst bit is cleared to 0 before switching the operating mode. bit 4: scan description 0 single mode (initial value) 1 scan mode for details of the operation in single mode and scan mode, see section 14.4, operation. bit 3?clock select (cks): same as cks in adcr0. bit 2?reserved: this bit is always read as 0, and should only be written with 0.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 445 of 818 rej09b0273-0500 bits 1 and 0?channel select 1 and 0 (ch1 and ch0): these bits, together with the scan bit, select the analog input channels. to prevent incorrect operation, ensure that the adst bit in a/d control/status register 1 (adcsr1) is cleared to 0 before changing the analog input channel selection. analog input channels bit 1: ch3 bit 0: ch0 single mode scan mode 0 0 an12 (initial value) an12 1 an13 an12, 13 1 0 an14 an12 ? 14 1 an15 an12 ? 15 14.2.5 a/d control register 1 (adcr1) a/d control register 1 (adcr1) is an 8-bit readable/writable register that controls the start of a/d conversion and selects the operating clock. adcr1 is initialized to h'7f by a power-on reset, and in hardware standby mode and software standby mode. bit:76543210 trge ??????? initial value:01111111 r/w:r/wrrrrrrr bit 7?trigger enable (trge): same as trge in adcr0. bits 6 to 0?reserved: these bits are always read as 1, and should only be written with 1.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 446 of 818 rej09b0273-0500 14.2.6 a/d trigger register (adtrgr) the a/d trigger register (adtrgr) is an 8-bit readable/writable register that selects the a/d0 trigger. either external pin ( adtrg ) or atu (atu interval timer interrupt) triggering can be selected. adtrgr is initialized to h'ff by a power-on reset, and in hardware standby mode and software standby mode. bit:76543210 extrg ??????? initial value:11111111 r/w:r/wrrrrrrr bit 7?trigger enable (extrg): selects external pin input ( adtrg ) or the atu interval timer interrupt. bit 7: extrga description 0 a/d conversion is triggered by the atu channel 0 interval timer interrupt 1 a/d conversion is triggered by external pin input ( adtrg ) (initial value) bits 6 to 0?reserved: these bits are always read as 1, and should only be written with 1. in order to select external triggering or atu triggering, the tgre bit in adcr0 must be set to 1. for details, see section 14.2.3, a/d control register 0.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 447 of 818 rej09b0273-0500 14.3 cpu interface a/d data registers 0 to 15 (addr0 to addr15) are 16-bit registers, but they are connected to the cpu by an 8-bit data bus. therefore, the upper and lower bytes must be read separately. to prevent the data being changed between the reads of the upper and lower bytes of an a/d data register, the lower byte is read via a temporary register (temp). the upper byte can be read directly. data is read from an a/d data register as follows. when the upper byte is read, the upper-byte value is transferred directly to the cpu and the lower-byte value is transferred into temp. next, when the lower byte is read, the temp contents are transferred to the cpu. when performing byte-size reads on an a/d data register, always read the upper byte before the lower byte. it is possible to read only the upper byte, but if only the lower byte is read, incorrect data may be obtained. if a word-size read is performed on an a/d data register, reading is performed in upper byte, lower byte order automatically. figure 14.2 shows the data flow for access to an a/d data register. cpu (h'aa) temp (h'40) addrnl (h'40) addrnh (h'aa) module data bus upper-byte read cpu (h'40) temp (h'40) addrnl (h'40) addrnh (h'aa) bus interface module data bus lower-byte read bus interface figure 14.2 a/d data register access operation (reading h'aa40)
section 14 a/d converter rev. 5.00 jan 06, 2006 page 448 of 818 rej09b0273-0500 14.4 operation the a/d converter operates by successive approximations with 10-bit resolution. it has two operating modes: single mode and scan mode. in single mode, conversion is performed once on one specified channel, then ends. in scan mode, a/d conversion continues on one or more specified channels until the adst bit is cleared to 0. 14.4.1 single mode single mode, should be selected when only one a/d conversion on one channel is required. single mode is selected for a/d0 by setting the adm1 and adm0 bits in a/d control/status register 0 (adscr0) to 00, and for a/d1 by clearing the scan mode bit in adcsr1 to 0. when the adst bit (in adcr0 for a/d0, or in adcsr1 for a/d1) is set to 1, a/d conversion is started in single mode. the adst bit remains set to 1 during a/d conversion, and is automatically cleared to 0 when conversion ends. when conversion ends, the adf flag in adcsr is set to 1. if the adie bit in adcsr is also 1, an adi interrupt is requested. to clear the adf flag, first read adf when set to 1, then write 0 in adf. if the dmac is activated by the adi interrupt, adf is cleared automatically. an example of the operation when analog input channel 1 (an1) is selected and a/d conversion is performed in single mode is described next. figure 14.3 shows a timing diagram for this example. 1. single mode is selected (adm1 = adm0 = 0), input channel an1 is selected (ch3 = ch2 = ch1 = 0, ch0 = 1), the a/d interrupt is enabled (adie = 1), and a/d conversion is started (adst = 1). 2. when a/d conversion is completed, the result is transferred to addr1. at the same time the adf flag is set to 1, the adst bit is cleared to 0, and the a/d converter becomes idle. 3. since adf = 1 and adie = 1, an adi interrupt is requested. 4. the a/d interrupt handling routine is started. 5. the routine reads adf set to 1, then writes 0 in adf. 6. the routine reads and processes the conversion result (addr1). 7. execution of the a/d interrupt handling routine ends. after this, if the adst bit is set to 1, a/d conversion starts again and steps 2 to 7 are repeated.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 449 of 818 rej09b0273-0500 idle set * set * a/d conver- sion starts set * clear * clear * idle idle idle a/d con- version (1) idle idle read conversion result read conversion result a/d conversion result (1) a/d conversion result (2) state of channel 0 (an0) adf adst adie state of channel 1 (an1) state of channel 2 (an2) state of channel 3 (an3) addr0 addr1 addr2 addr3 note: * vertical arrows ( ) indicate instructions executed by software. a/d con- version (2) figure 14.3 example of a/d converter operation (single mode, channel 1 selected)
section 14 a/d converter rev. 5.00 jan 06, 2006 page 450 of 818 rej09b0273-0500 14.4.2 scan mode scan mode is useful for monitoring analog inputs in a group of one or more channels. scan mode is selected for a/d0 by setting the adm1 and adm0 bits in a/d control/status register 0 (adscr0) to 01 (4-channel scan mode), 10 8-channel scan mode), or 11 (12-channel scan mode), and for a/d1 by setting the scan bit in a/d control/status register 1 (adcsr1) to 1. when the adst bit is set to 1, a/d conversion is started in scan mode. in scan mode, a/d conversion is performed in low-to-high analog input channel number order (an0, an1 ... an15). the adst bit remains set to 1 until written with 0 by software. when all conversions are completed within one selected analog group, the adf flag in adcsr is set to 1 and a/d conversion us repeated. when adf is set to 1, if the adie bit in adcsr is also 1, an adi interrupt (adi0 or adi1) is requested. to clear the adf flag, first read adf when set to 1, then write 0 in adf. if the dmac is activated by the adi interrupt, adf is cleared automatically. an example of the operation when analog input channels 0 to 2 and 4 to 6 (an0 to an2 and an4 to an6) are selected and a/d conversion is performed in 8-channel scan mode is described in figure 14.4. figure 14.6 shows a timing diagram for this example. 1. 8-channel scan mode is selected (adm1 = 1, adm0 = 0), input channels an0 to an2 and an4 to an6 are selected (ch3 = 0, ch2 = 0, ch1 = 1, ch0 = 0), and a/d conversion is started. 2. when conversion of the first channel (an0) is completed, the result is transferred to addr0. next, conversion of the second channel (an1) starts automatically. 3. conversion proceeds in the same way through the third channel (an2). 4. when conversion is completed for all the channels (an0 to an2) in one selected analog group (analog group 0), the adf flag is set to 1. if the adie bit is also 1, an adi interrupt is requested. 5. conversion of the fourth channel (an4) starts automatically. 6. conversion proceeds in the same way through the sixth channel (an6) 7. steps 2 to 6 are repeated as long as the adst bit remains set to 1. when the adst bit is cleared to 0, a/d conversion stops. after this, if the adst bit is set to 1, a/d conversion starts again from the first channel (an0).
section 14 a/d converter rev. 5.00 jan 06, 2006 page 451 of 818 rej09b0273-0500 continuous a/d conversion set * 1 adst adf addr0 addr1 addr2 addr3 addr4 addr5 addr6 addr7 clear * 1 clear * 1 * 2 state of channel 0 (an0) state of channel 1 (an1) state of channel 2 (an2) state of channel 3 (an3) state of channel 4 (an4) state of channel 5 (an5) tate of channel 6 (an6) state of channel 7 (an7) idle idle idle idle idle idle idle idle idle idle idle idle idle idle idle idle idle a/d conversion result (10) a/d conversion result (6) notes: 1. vertical arrows ( ) indicate instructions executed by software. 2. data currently being converted is ignored. a/d conversion result (5) a/d conver- sion (1) a/d conver- sion (2) a/d conver- sion (3) a/d conver- sion (7) a/d conver- sion (8) a/d conver- sion (9) idle a/d conver- sion (10) a/d conver- sion (11) idle a/d conver- sion (5) a/d conver- sion (6) a/d conver- sion (4) a/d conversion result (7) a/d conversion result (8) a/d conversion result (9) a/d conversion result (3) a/d conversion result (2) a/d conversion result (1) a/d conversion result (4) figure 14.4 example of a/d converter operation (scan mode, channels an0 to an2 and an4 to an6 selected)
section 14 a/d converter rev. 5.00 jan 06, 2006 page 452 of 818 rej09b0273-0500 14.4.3 analog input setting and a/d conversion time the a/d converter has a built-in sample-and-hold circuit in a/d0 and a/d1. the a/d converter samples the analog input at time t d (a/d conversion start delay time) after the adst bit is set to 1, then starts conversion. figure 14.5 shows the a/d conversion timing. the a/d conversion time (t conv ) includes t d and the analog input sampling time (t spl ). the length of t d is not fixed, since it includes the time required for synchronization of the a/d conversion operation. the total conversion time therefore varies within the ranges shown in table 14.4. in scan mode, the t conv values given in table 14.4 apply to the first conversion. in the second and subsequent conversions, t conv is fixed at 256 states when cks = 0 or 128 states when cks = 1. table 14.4 a/d conversion time (single mode) cks = 0 cks = 1 item symbol min typ max min typ max unit a/d conversion start delay time t d 10 ? 17 6 ? 9 states input sampling time (a/d0) t spl ? 64 ?? 32 ? input sampling time (a/d1) t spl ? 64 ?? 32 ? a/d conversion time t conv 259 ? 266 131 ? 134
section 14 a/d converter rev. 5.00 jan 06, 2006 page 453 of 818 rej09b0273-0500 a/d conversion sample-and-hold idle end of a/d conversion a/d conversion time (t conv ) analog input sampling time (t spl ) a/d conversion start delay time (t d ) write cycle a/d synchronization time (3 states) (to 14 states) adst write timing address internal write signal a/d converter adf analog input sampling signal figure 14.5 a/d conversion timing
section 14 a/d converter rev. 5.00 jan 06, 2006 page 454 of 818 rej09b0273-0500 14.4.4 external triggering of a/d conversion a/d conversion can be externally triggered. to activate the a/d converter with an external trigger, first set the pin functions with the pfc (pin function controller), then set the trge bit to 1 in the a/d control register (adcr). for the a/d0 converter module, also set the extrg bit in the a/d trigger register (adtrgr). when a low-level pulse is input to the adtrg pin after these settings have been made, the a/d converter detects the falling edge of the pulse and sets the adst bit to 1. figure 14.6 shows the timing for external trigger input. the adst bit is set to 1 one state after the a/d converter samples the falling edge on the adtrg pin. the timing from setting of the adst bit until the start of a/d conversion is the same as when 1 is written into the adst bit by software. adtrg pin sampled adtrg input adst bit adst = 1 figure 14.6 external trigger input timing
section 14 a/d converter rev. 5.00 jan 06, 2006 page 455 of 818 rej09b0273-0500 14.4.5 a/d converter activation by atu the a/d0 converter module can be activated by an a/d conversion request from the atu ? s channel 0 interval timer. to activate the a/d converter by means of the atu, set the trge bit to 1 in a/d control register 0 (adcr0) and clear the extrg bit to 0 in the a/d trigger register (adtrgr). when an atu channel 0 interval timer a/d conversion request is generated after these settings have been made, the adst bit set to 1. the timing from setting of the adst bit until the start of a/d conversion is the same as when 1 is written into the adst bit by software. 14.4.6 adend output pin when channel 15 is used in scan mode, the conversion timing can be monitored with the adend output pin. after the channel 15 analog voltage has been latched in scan mode, and conversion has started, the adend pin goes high. the adend pin subsequently goes low when channel 15 conversion ends. idle a/d conversion idle idle idle idle idle idle idle idle adend state of channel 12 (an12) state of channel 13 (an13) state of channel 14 (an14) state of channel 15 (an15) a/d conversion a/d conversion a/d conversion a/d conversion a/d conversion a/d conversion figure 14.7 adend output timing
section 14 a/d converter rev. 5.00 jan 06, 2006 page 456 of 818 rej09b0273-0500 14.5 interrupt sources and dma transfer requests the a/d converter can generate an a/d conversion end interrupt request (adi0 or adi1) upon completion of a/d conversions. the adi interrupt can be enabled by setting the adie bit in the a/d control/status register (adcsr) to 1, or disabled by clearing the adie bit to 0. the dmac can be activated by an adi interrupt. in this case an interrupt request is not sent to the cpu. when the dmac is activated by an adi interrupt, the adf bit in adcsr is automatically cleared when data is transferred by the dmac. see section 9.4.3, example of dma transfer between a/d converter and internal memory, for an example of this operation. 14.6 usage notes the following points should be noted when using the a/d converter. 1. analog input voltage range the voltage applied to analog input pins during a/d conversion should be in the range av ss ann av ref . 2. relation between av cc , av ss and v cc , v ss when using the a/d converter, set av cc = v cc 10%, and av ss = v ss . when the a/d converter is not used, set av ss = v ss , and do not leave the av cc pin open. 3. av ref input range set av ref = 4.5 v to av cc when the a/d converter is used, and av ref av cc when not used.. if conditions 1 , 2 , and 3 above are not met, the reliability of the device may be adversely affected. 4. notes on board design in board design, digital circuitry and analog circuitry should be as mutually isolated as possible, and layout in which digital circuit signal lines and analog circuit signal lines cross or are in close proximity should be avoided as far as possible. failure to do so may result in incorrect operation of the analog circuitry due to inductance, adversely affecting a/d conversion values. also, digital circuitry must be isolated from the analog input signals (ann), analog reference voltage (av ref ), and analog power supply (av cc ) by the analog ground (av ss ). the av ss should be connected at one point to a stable digital ground (v ss ) on the board.
section 14 a/d converter rev. 5.00 jan 06, 2006 page 457 of 818 rej09b0273-0500 5. notes on noise countermeasures a protection circuit connected to prevent damage due to an abnormal voltage such as an excessive surge at the analog input pins (ann) and analog reference voltage (av ref ) should be connected between av cc and av ss as shown in figure 14.8. also, the bypass capacitors connected to av cc and av ref and the filter capacitor connected to ann must be connected to av ss . if a filter capacitor is connected as shown in figure 14.8, the input currents at the analog input pins (ann) are averaged, and so an error may arise. careful consideration is therefore required when deciding the circuit constants. av cc av ref an0 ? an15 av ss sh7050 notes: 10 f 0.01 f r in * 2 * 1 * 1 0.1 f 100 ? 1. 2. r in : input impedance figure 14.8 example of analog input pin protection circuit table 14.5 analog pin specifications item min max unit analog input capacitance ? 20 pf permissible signal source impedance ? 3k ?
section 14 a/d converter rev. 5.00 jan 06, 2006 page 458 of 818 rej09b0273-0500 6. a/d conversion precision definitions a/d conversion precision definitions are given below. a. resolution the number of a/d converter digital conversion output codes b. offset error the deviation of the analog input voltage value from the ideal a/d conversion characteristic when the digital output changes from the minimum voltage value 0000000000 to 0000000001 (see figure 14.9). c. full-scale error the deviation of the analog input voltage value from the ideal a/d conversion characteristic when the digital output changes from 1111111110 to 111111111 (see figure 14.9). d. quantization error the deviation inherent in the a/d converter, given by 1/2 lsb (see figure 14.8). e. nonlinearity error the error with respect to the ideal a/d conversion characteristic between the zero voltage and the full-scale voltage. does not include the offset error, full-scale error, or quantization error. f. absolute precision the deviation between the digital value and the analog input value. includes the offset error, full-scale error, quantization error, and nonlinearity error. digital output 111 110 101 100 011 010 001 000 1/8 2/8 3/8 4/8 5/8 6/8 7/8 fs 0 analog input voltage quantization error ideal a/d conversion characteristic digital output fs analog input voltage offset error ideal a/d conversion characteristic actual a/d conversion characteristic full-scale error nonlinearity error figure 14.9 a/d conversion precision definitions
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 459 of 818 rej09b0273-0500 section 15 compare match timer (cmt) 15.1 overview the sh7050 series has an on-chip compare match timer (cmt) configured of 16-bit timers for two channels. the cmt has 16-bit counters and can generate interrupts at set intervals. 15.1.1 features the cmt has the following features: ? four types of counter input clock can be selected ? one of four internal clocks ( /8, /32, /128, /512) can be selected independently for each channel. ? interrupt sources ? a compare match interrupt can be requested independently for each channel.
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 460 of 818 rej09b0273-0500 15.1.2 block diagram figure 15.1 shows a block diagram of the cmt. cm10 control circuit internal bus clock selection control circuit clock selection cmi1 /8 /32 /128 /512 /8 /32 /128 /512 cmcsr1 cmcor1 cmcnt1 cmcnt0 cmcor0 comparator cmstr cmcsr0 comparator bus interface module bus cmt cmstr: cmcsr: cmcor: cmcnt: cmi: compare match timer start register compare match timer control/status register compare match timer constant register compare match timer counter compare match interrupt figure 15.1 cmt block diagram
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 461 of 818 rej09b0273-0500 15.1.3 register configuration table 15.1 summarizes the cmt register configuration. table 15.1 register configuration channel name abbreviation r/w initial value address access size (bits) shared compare match timer start register cmstr r/w h'0000 h'ffff83d0 8, 16, 32 0 compare match timer control/status register 0 cmcsr0 r/(w) * h'0000 h'ffff83d2 8, 16, 32 compare match timer counter 0 cmcnt0 r/w h'0000 h'ffff83d4 8, 16, 32 compare match timer constant register 0 cmcor0 r/w h'ffff h'ffff83d6 8, 16, 32 1 compare match timer control/status register 1 cmcsr1 r/(w) * h'0000 h'ffff83d8 8, 16, 32 compare match timer counter 1 cmcnt1 r/w h'0000 h'ffff83da 8, 16, 32 compare match timer constant register 1 cmcor1 r/w h'ffff h'ffff83dc 8, 16, 32 notes: with regard to access size, two cycles are required for byte access and word access, and four cycles for longword access. * the only value that can be written to the cmcsr0 and cmcsr1 cmf bits is a 0 to clear the flags.
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 462 of 818 rej09b0273-0500 15.2 register descriptions 15.2.1 compare match timer start register (cmstr) the compare match timer start register (cmstr) is a 16-bit register that selects whether to operate or halt the channel 0 and channel 1 counters (cmcnt). it is initialized to h'0000 by a power-on reset and in standby modes. bit: 15 14 13 12 11 10 9 8 ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 ??????str1str0 initial value:00000000 r/w:rrrrrrr/wr/w bits 15?2?reserved: these bits always read as 0. the write value should always be 0. bit 1?count start 1 (str1): selects whether to operate or halt compare match timer counter 1. bit 1: str1 description 0 cmcnt1 count operation halted (initial value) 1 cmcnt1 count operation bit 0?count start 0 (str0): selects whether to operate or halt compare match timer counter 0. bit 0: str0 description 0 cmcnt0 count operation halted (initial value) 1 cmcnt0 count operation
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 463 of 818 rej09b0273-0500 15.2.2 compare match timer control/status register (cmcsr) the compare match timer control/status register (cmcsr) is a 16-bit register that indicates the occurrence of compare matches, sets the enable/disable of interrupts, and establishes the clock used for incrementation. it is initialized to h'0000 by a power-on reset and in hardware standby mode and software standby mode. bit: 15 14 13 12 11 10 9 8 ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 cmfcmie????cks1cks0 initial value:00000000 r/w: r/(w) * r/wrrrrr/wr/w note: * the only value that can be written is a 0 to clear the flag. bits 15?8 and 5?2?reserved: these bits always read as 0. the write value should always be 0. bit 7?compare match flag (cmf): this flag indicates whether or not the cmcnt and cmcor values have matched. bit 7: cmf description 0 cmcnt and cmcor values have not matched (initial status) clear condition: write a 0 to cmf after reading a 1 from it 1 cmcnt and cmcor values have matched bit 6?compare match interrupt enable (cmie): selects whether to enable or disable a compare match interrupt (cmi) when the cmcnt and cmcor values have matched (cmf = 1). bit 6: cmie description 0 compare match interrupts (cmi) disabled (initial status) 1 compare match interrupts (cmi) enabled
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 464 of 818 rej09b0273-0500 bits 1, 0?clock select 1, 0 (cks1, cks0): these bits select the clock input to the cmcnt from among the four internal clocks obtained by dividing the system clock ( ). when the str bit of the cmstr is set to 1, the cmcnt begins incrementing with the clock selected by cks1 and cks0. bit 1: cks1 bit 0: cks0 description 00 /8 (initial status) 1 /32 10 /128 1 /512 15.2.3 compare match timer counter (cmcnt) the compare match timer counter (cmcnt) is a 16-bit register used as an upcounter for generating interrupt requests. when an internal clock is selected with the cks1, cks0 bits of the cmcsr register and the str bit of the cmstr is set to 1, the cmcnt begins incrementing with that clock. when the cmcnt value matches that of the compare match timer constant register (cmcor), the cmcnt is cleared to h'0000 and the cmf flag of the cmcsr is set to 1. if the cmie bit of the cmcsr is set to 1 at this time, a compare match interrupt (cmi) is requested. the cmcnt is initialized to h'0000 by a power-on reset and in hardware standby mode and software standby mode. bit: 15 14 13 12 11 10 9 8 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 465 of 818 rej09b0273-0500 15.2.4 compare match timer constant register (cmcor) the compare match timer constant register (cmcor) is a 16-bit register that sets the compare match period with the cmcnt. the cmcor is initialized to h'ffff by a power-on reset and in hardware standby mode and software standby mode. there is no initializing with manual reset. bit: 15 14 13 12 11 10 9 8 initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w 15.3 operation 15.3.1 period count operation when an internal clock is selected with the cks1, cks0 bits of the cmcsr register and the str bit of the cmstr is set to 1, the cmcnt begins incrementing with the selected clock. when the cmcnt counter value matches that of the compare match constant register (cmcor), the cmcnt counter is cleared to h'0000 and the cmf flag of the cmcsr register is set to 1. if the cmie bit of the cmcsr register is set to 1 at this time, a compare match interrupt (cmi) is requested. the cmcnt counter begins counting up again from h'0000. figure 15.2 shows the compare match counter operation.
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 466 of 818 rej09b0273-0500 cmcor h'0000 cmcnt value time counter cleared by cmcor compare match figure 15.2 counter operation 15.3.2 cmcnt count timing one of four clocks ( /8, /32, /128, /512) obtained by dividing the system clock (ck) can be selected by the cks1, cks0 bits of the cmcsr. figure 15.3 shows the timing. ck n ? 1 n n + 1 internal clock cmcnt input clock cmcnt figure 15.3 count timing 15.4 interrupts 15.4.1 interrupt sources and dtc activation the cmt has a compare match interrupt for each channel, with independent vector addresses allocated to each of them. the corresponding interrupt request is output when the interrupt request flag cmf is set to 1 and the interrupt enable bit cmie has also been set to 1. when activating cpu interrupts by interrupt request, the priority between the channels can be changed by using the interrupt controller settings. see section 6, interrupt controller, for details.
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 467 of 818 rej09b0273-0500 15.4.2 compare match flag set timing the cmf bit of the cmcsr register is set to 1 by the compare match signal generated when the cmcor register and the cmcnt counter match. the compare match signal is generated upon the final state of the match (timing at which the cmcnt counter matching count value is updated). consequently, after the cmcor register and the cmcnt counter match, a compare match signal will not be generated until a cmcnt counter input clock occurs. figure 15.4 shows the cmf bit set timing. ck cmcnt input clock cmcnt cmcor compare match signal cmf cmi n n 0 figure 15.4 cmf set timing
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 468 of 818 rej09b0273-0500 15.4.3 compare match flag clear timing the cmf bit of the cmcsr register is cleared either by writing a 0 to it after reading a 1, or by a clear signal after a dtc transfer. figure 15.5 shows the timing when the cmf bit is cleared by the cpu. t 2 t 1 ck cmf cmcsr write cycle figure 15.5 timing of cmf clear by the cpu
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 469 of 818 rej09b0273-0500 15.5 notes on use take care that the contentions described in sections 15.5.1?15.5.3 do not arise during cmt operation. 15.5.1 contention between cmcnt write and compare match if a compare match signal is generated during the t 2 state of the cmcnt counter write cycle, the cmcnt counter clear has priority, so the write to the cmcnt counter is not performed. figure 15.6 shows the timing. t 1 t 2 ck address internal write signal compare match signal cmcnt cmcnt write cycle cmcnt n h'0000 figure 15.6 cmcnt write and compare match contention
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 470 of 818 rej09b0273-0500 15.5.2 contention between cmcnt word write and incrementation if an increment occurs during the t 2 state of the cmcnt counter word write cycle, the counter write has priority, so no increment occurs. figure 15.7 shows the timing. cmcnt write data t 1 t 2 ck address internal write signal compare match signal cmcnt cmcnt write cycle cmcnt nm figure 15.7 cmcnt word write and increment contention
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 471 of 818 rej09b0273-0500 15.5.3 contention between cmcnt byte write and incrementation if an increment occurs during the t 2 state of the cmcnt byte write cycle, the counter write has priority, so no increment of the write data results on the writing side. the byte data on the side not performing the writing is also not incremented, so the contents are those before the write. figure 15.8 shows the timing when an increment occurs during the t 2 state of the cmcnth write cycle. t 1 t 2 ck address internal write signal cmcnt input clock cmcnth cmcnt write cycle cmcnth n m cmcnth write data x x cmcntl figure 15.8 cmcnt byte write and increment contention
section 15 compare match timer (cmt) rev. 5.00 jan 06, 2006 page 472 of 818 rej09b0273-0500
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 473 of 818 rej09b0273-0500 section 16 pin function controller (pfc) 16.1 overview the pin function controller (pfc) consists of registers for selecting multiplex pin functions and their input/output direction. table 16.1 shows the sh7050?s multiplex pins. table 16.1 sh7050 multiplex pins port function 1 (related module) function 2 (related module) function 3 (related module) function 4 (related module) a pa15 input/output (port) a15 output (bsc) a pa14 input/output (port) a14 output (bsc) a pa13 input/output (port) a13 output (bsc) a pa12 input/output (port) a12 output (bsc) a pa11 input/output (port) a11 output (bsc) a pa10 input/output (port) a10 output (bsc) a pa9 input/output (port) a9 output (bsc) a pa8 input/output (port) a8 output (bsc) a pa7 input/output (port) a7 output (bsc) a pa6 input/output (port) a6 output (bsc) a pa5 input/output (port) a5 output (bsc) a pa4 input/output (port) a4 output (bsc) a pa3 input/output (port) a3 output (bsc) a pa2 input/output (port) a2 output (bsc) a pa1 input/output (port) a1 output (bsc) a pa0 input/output (port) a0 output (bsc) b pb11 input/output (port) a21 output (bsc) pod input (port) b pb10 input/output (port) a20 output (bsc) b pb9 input/output (port) a19 output (bsc) b pb8 input/output (port) a18 output (bsc) b pb7 input/output (port) a17 output (bsc) b pb6 input/output (port) a16 output (bsc) b pb5 input/output (port) tclkb input (atu)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 474 of 818 rej09b0273-0500 port function 1 (related module) function 2 (related module) function 3 (related module) function 4 (related module) b pb4 input/output (port) tclka input (atu) b pb3 input/output (port) to9 output (atu) b pb2 input/output (port) to8 output (atu) b pb1 input/output (port) to7 output (atu) b pb0 input/output (port) to6 output (atu) c pc14 input/output (port) toh10 output (atu) c pc13 input/output (port) tog10 output (atu) c pc12 input/output (port) tof10 output (atu) drak1 output (dmac) c pc11 input/output (port) toe10 output (atu) drak0 output (dmac) c pc10 input/output (port) tod10 output (atu) c pc9 input/output (port) toc10 output (atu) c pc8 input/output (port) tob10 output (atu) c pc7 input/output (port) toa10 output (atu) c pc6 input/output (port) cs2 output (bsc) irq6 output (intc) adend output (a/d) c pc5 input/output (port) cs1 output (bsc) c pc4 input/output (port) cs0 output (bsc) c pc3 input/output (port) rd output (bsc) c pc2 input/output (port) wait input (bsc) c pc1 input/output (port) wrh output (bsc) c pc0 input/output (port) wrl output (bsc) d pd15 input/output (port) d15 input/output (bsc) d pd14 input/output (port) d14 input/output (bsc) d pd13 input/output (port) d13 input/output (bsc) d pd12 input/output (port) d12 input/output (bsc) d pd11 input/output (port) d11 input/output (bsc) d pd10 input/output (port) d10 input/output (bsc) d pd9 input/output (port) d9 input/output (bsc) d pd8 input/output (port) d8 input/output (bsc) d pd7 input/output (port) d7 input/output (bsc)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 475 of 818 rej09b0273-0500 port function 1 (related module) function 2 (related module) function 3 (related module) function 4 (related module) d pd6 input/output (port) d6 input/output (bsc) d pd5 input/output (port) d5 input/output (bsc) d pd4 input/output (port) d4 input/output (bsc) d pd3 input/output (port) d3 input/output (bsc) d pd2 input/output (port) d2 input/output (bsc) d pd1 input/output (port) d1 input/output (bsc) d pd0 input/output (port) d0 input/output (bsc) e pe14 input/output (port) tioc3 input/output (atu) e pe13 input/output (port) tiob3 input/output (atu) e pe12 input/output (port) tioa3 input/output (atu) e pe11 input/output (port) tid0 input (atu) e pe10 input/output (port) tic0 input (atu) e pe9 input/output (port) tib0 input (atu) e pe8 input/output (port) tia0 input (atu) e pe7 input/output (port) tiob2 input/output (atu) e pe6 input/output (port) tioa2 input/output (atu) e pe5 input/output (port) tiof1 input/output (atu) e pe4 input/output (port) tioe1 input/output (atu) e pe3 input/output (port) tiod1 input/output (atu) e pe2 input/output (port) tioc1 input/output (atu) e pe1 input/output (port) tiob1 input/output (atu) e pe0 input/output (port) tioa1 input/output (atu) f pf11 input/output (port) breq input (bsc) puls7 output (apc) f pf10 input/output (port) back output (bsc) puls6 output (apc) f pf9 input/output (port) cs3 output (bsc) irq7 input (intc) puls5 output (apc) f pf8 input/output (port) sck2 input/output (sci) puls4 output (apc) f pf7 input/output (port) dreq0 input (dmac) puls3 output (apc)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 476 of 818 rej09b0273-0500 port function 1 (related module) function 2 (related module) function 3 (related module) function 4 (related module) f pf6 input/output (port) dack0 output (dmac) puls2 output (apc) f pf5 input/output (port) dreq1 input (dmac) puls1 output (apc) f pf4 input/output (port) dack1 input (dmac) puls0 output (apc) f pf3 input/output (port) irq3 input (intc) f pf2 input/output (port) irq2 input (intc) f pf1 input/output (port) irq1 input (intc) f pf0 input/output (port) irq0 input (intc) g pg15 input/output (port) irq5 input (intc) tiob5 input/output (atu) g pg14 input/output (port) irq4 input (intc) tioa5 input/output (atu) g pg13 input/output (port) tiod4 input/output (atu) g pg12 input/output (port) tioc4 input/output (atu) g pg11 input/output (port) tiob4 input/output (atu) g pg10 input/output (port) tioa4 input/output (atu) g pg9 input/output (port) tiod3 input/output (atu) g pg8 input/output (port) rxd2 input (sci) g pg7 input/output (port) txd2 output (sci) g pg6 input/output (port) rxd1 input (sci) g pg5 input/output (port) txd1 output (sci) g pg4 input/output (port) sck1 input/output (sci) g pg3 input/output (port) rxd0 input (sci) g pg2 input/output (port) txd0 output (sci) g pg1 input/output (port) sck0 input/output (sci) g pg0 input/output (port) adtrg input (a/d) irqout output (intc) h ph15 input (port) an15 input (a/d) h ph14 input (port) an14 input (a/d) h ph13 input (port) an13 input (a/d) h ph12 input (port) an12 input (a/d)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 477 of 818 rej09b0273-0500 port function 1 (related module) function 2 (related module) function 3 (related module) function 4 (related module) h ph11 input (port) an11 input (a/d) h ph10 input (port) an10 input (a/d) h ph9 input (port) an9 input (a/d) h ph8 input (port) an8 input (a/d) h ph7 input (port) an7 input (a/d) h ph6 input (port) an6 input (a/d) h ph5 input (port) an5 input (a/d) h ph4 input (port) an4 input (a/d) h ph3 input (port) an3 input (a/d) h ph2 input (port) an2 input (a/d) h ph1 input (port) an1 input (a/d) h ph0 input (port) an0 input (a/d)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 478 of 818 rej09b0273-0500 16.2 register configuration pfc registers are listed in table 16.2. table 16.2 pfc registers name abbreviation r/w initial value address access size port a io register paior r/w h'0000 h'ffff8382 8, 16 port a control register pacr r/w h'0000 h'ffff8384 8, 16 port b io register pbior r/w h'c0c0 h'ffff8388 8, 16 port b control register pbcr r/w h'80c0 h'ffff838a 8, 16 port c io register pcior r/w h'8000 h'ffff8392 8, 16 port c control register 1 pccr1 r/w h'c000 h'ffff8394 8, 16 port c control register 2 pccr2 r/w h'0bff h'ffff8396 8, 16 port d io register pdior r/w h'0000 h'ffff839a 8, 16 port d control register pdcr r/w h'0000 h'ffff839c 8, 16 ck control register * ckcr r/w h'fffe h'ffff839e 8, 16 port e io register peior r/w h'8000 h'ffff83a2 8, 16 port e control register pecr r/w h'8000 h'ffff83a4 8, 16 port f io register pfior r/w h'f000 h'ffff83a8 8, 16 port f control register 1 pfcr1 r/w h'ff00 h'ffff83aa 8, 16 port f control register 2 pfcr2 r/w h'00aa h'ffff83ac 8, 16 port g io register pgior r/w h'0000 h'ffff83b0 8, 16 port g control register 1 pgcr1 r/w h'0aaa h'ffff83b2 8, 16 port g control register 2 pgcr2 r/w h'aa80 h'ffff83b4 8, 16 notes: a register access is performed in 2 cycles regardless of the access size. * ck control register is only bult in the version of flash memory. it is not in the version of mask rom.
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 479 of 818 rej09b0273-0500 16.3 register descriptions 16.3.1 port a io register (paior) bit:1514131211109876543210 pa15 ior pa14 ior pa13 ior pa12 ior pa11 ior pa10 ior pa9 ior pa8 ior pa7 ior pa6 ior pa5 ior pa4 ior pa3 ior pa2 ior pa1 ior pa0 ior initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port a io register (paior) is a 16-bit readable/writable register that selects the input/output direction of the 16 pins in port a. bits pa15ior to pa0ior correspond to pins pa15/a15 to pa0/a0. paior is enabled when port a pins function as general input/output pins (pa15 to pa0), and disabled otherwise. when port a pins function as pa15 to pa0, a pin becomes an output when the corresponding bit in paior is set to 1, and an input when the bit is cleared to 0. paior is initialized to h'0000 by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. 16.3.2 port a control register (pacr) bit:1514131211109876543210 pa15 md pa14 md pa13 md pa12 md pa11 md pa10 md pa9 md pa8 md pa7 md pa6 md pa5 md pa4 md pa3 md pa2 md pa1 md pa0 md initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port a control register (pacr) is a 16-bit readable/writable register that selects the functions of the 16 multiplex pins in port a. pacr settings are not valid in all operating modes. 1. expanded mode with on-chip rom disabled port a pins function as address output pins, and pacr settings are invalid. 2. expanded mode with on-chip rom enabled port a pins are multiplexed as address output pins and general input/output pins. pacr settings are valid. 3. single-chip mode port a pins function as general input/output pins, and pacr settings are invalid.
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 480 of 818 rej09b0273-0500 pacr is initialized to h'0000 by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. bit 15?pa15 mode bit (pa15md): selects the function of pin pa15/a15. description bit 15: pa15md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a15) (initial value) general input/output (pa15) (initial value) general input/output (pa15) (initial value) 1 address output (a15) address output (a15) general input/output (pa15) bit 14?pa14 mode bit (pa14md): selects the function of pin pa14/a14. description bit 14: pa14md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a14) (initial value) general input/output (pa14) (initial value) general input/output (pa14) (initial value) 1 address output (a14) address output (a14) general input/output (pa14) bit 13?pa13 mode bit (pa13md): selects the function of pin pa13/a13. description bit 13: pa13md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a13) (initial value) general input/output (pa13) (initial value) general input/output (pa13) (initial value) 1 address output (a13) address output (a13) general input/output (pa13) bit 12?pa12 mode bit (pa12md): selects the function of pin pa12/a12. description bit 12: pa12md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a12) (initial value) general input/output (pa12) (initial value) general input/output (pa12) (initial value) 1 address output (a12) address output (a12) general input/output (pa12)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 481 of 818 rej09b0273-0500 bit 11?pa11 mode bit (pa11md): selects the function of pin pa11/a11. description bit 11: pa11md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a11) (initial value) general input/output (pa11) (initial value) general input/output (pa11) (initial value) 1 address output (a11) address output (a11) general input/output (pa11) bit 10?pa10 mode bit (pa10md): selects the function of pin pa10/a10. description bit 10: pa10md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a10) (initial value) general input/output (pa10) (initial value) general input/output (pa10) (initial value) 1 address output (a10) address output (a10) general input/output (pa10) bit 9?pa9 mode bit (pa9md): selects the function of pin pa9/a9. description bit 9: pa9md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a9) (initial value) general input/output (pa9) (initial value) general input/output (pa9) (initial value) 1 address output (a9) address output (a9) general input/output (pa9) bit 8?pa8 mode bit (pa8md): selects the function of pin pa8/a8. description bit 8: pa8md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a8) (initial value) general input/output (pa8) (initial value) general input/output (pa8) (initial value) 1 address output (a8) address output (a8) general input/output (pa8)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 482 of 818 rej09b0273-0500 bit 7?pa7 mode bit (pa7md): selects the function of pin pa7/a7. description bit 7: pa7md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a7) (initial value) general input/output (pa7) (initial value) general input/output (pa7) (initial value) 1 address output (a7) address output (a7) general input/output (pa8) bit 6?pa6 mode bit (pa6md): selects the function of pin pa6/a6. description bit 6: pa6md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a6) (initial value) general input/output (pa6) (initial value) general input/output (pa6) (initial value) 1 address output (a6) address output (a6) general input/output (pa6) bit 5?pa5 mode bit (pa5md): selects the function of pin pa5/a5. description bit 5: pa5md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a5) (initial value) general input/output (pa5) (initial value) general input/output (pa5) (initial value) 1 address output (a5) address output (a5) general input/output (pa5) bit 4?pa4 mode bit (pa4md): selects the function of pin pa4/a4. description bit 4: pa4md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a4) (initial value) general input/output (pa4) (initial value) general input/output (pa4) (initial value) 1 address output (a4) address output (a4) general input/output (pa4)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 483 of 818 rej09b0273-0500 bit 3?pa3 mode bit (pa3md): selects the function of pin pa3/a3. description bit 3: pa3md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a3) (initial value) general input/output (pa3) (initial value) general input/output (pa3) (initial value) 1 address output (a3) address output (a3) general input/output (pa3) bit 2?pa2 mode bit (pa2md): selects the function of pin pa2/a2. description bit 2: pa2md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a2) (initial value) general input/output (pa2) (initial value) general input/output (pa2) (initial value) 1 address output (a2) address output (a2) general input/output (pa2) bit 1?pa1 mode bit (pa1md): selects the function of pin pa1/a1. description bit 1: pa1md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a1) (initial value) general input/output (pa1) (initial value) general input/output (pa1) (initial value) 1 address output (a1) address output (a1) general input/output (pa1) bit 0?pa0 mode bit (pa0md): selects the function of pin pa0/a0. description bit 0: pa0md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a0) (initial value) general input/output (pa0) (initial value) general input/output (pa0) (initial value) 1 address output (a0) address output (a0) general input/output (pa0)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 484 of 818 rej09b0273-0500 16.3.3 port b io register (pbior) bit:1514131211109876543210 ?? pb11 ior pb10 ior pb9 ior pb8 ior pb7 ior pb6 ior ?? pb5 ior pb4 ior pb3 ior pb2 ior pb1 ior pb0 ior initial value:1100000011000000 r/w: r r r/w r/w r/w r/w r/w r/w r r r/w r/w r/w r/w r/w r/w the port b io register (pbior) is a 16-bit readable/writable register that selects the input/output direction of the 12 pins in port b. bits pb11ior to pb0ior correspond to pins pb11/a21/ pod to pb0/to6. pbior is enabled when port b pins function as general input/output pins (pb11 to pb0), and disabled otherwise. pbior bits 4 and 5 should be cleared to 0 when atu clock input is selected. when port b pins function as pb11 to pb0, a pin becomes an output when the corresponding bit in pbior is set to 1, and an input when the bit is cleared to 0. pbior is initialized to h'c0c0 by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. 16.3.4 port b control register (pbcr) bit:1514131211109876543210 ? pb11 md1 pb11 md0 pb10 md pb9 md pb8 md pb7 md pb6 md ?? pb5 md pb4 md pb3 md pb2 md pb1 md pb0 md initial value:1000000011000000 r/w: r r/w r/w r/w r/w r/w r/w r/w r r r/w r/w r/w r/w r/w r/w the port b control register (pbcr) is a 16-bit readable/writable register that selects the functions of the 12 multiplex pins in port b. pbcr is initialized to h'80c0 by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. bit 15?reserved: this bit is always read as 1, and should only be written with 1.
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 485 of 818 rej09b0273-0500 bits 14 and 13?pb11 mode bits 1 and 0 (pb11md1, pb11md0): these bits select the function of pin pb11/a21/ pod . description bit 14: pb11md1 bit 13: pb11md0 expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 0 address output (a21) (initial value) general input/output (pb11) (initial value) general input/output (pb11) (initial value) 1 address output (a21) address output (a21) general input/output (pb11) 1 0 address output (a21) port output disable input ( pod ) port output disable input ( pod ) 1 reserved reserved reserved bit 12?pb10 mode bit (pb10md): selects the function of pin pb10/a20. description bit 12: pb10md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a20) (initial value) general input/output (pb10) (initial value) general input/output (pb10) (initial value) 1 address output (a20) address output (a20) general input/output (pb10) bit 11?pb9 mode bit (pb9md): selects the function of pin pb9/a19. description bit 11: pb9md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a19) (initial value) general input/output (pb9) (initial value) general input/output (pb9) (initial value) 1 address output (a19) address output (a19) general input/output (pb9)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 486 of 818 rej09b0273-0500 bit 10?pb8 mode bit (pb8md): selects the function of pin pb8/a18. description bit 10: pb8md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a18) (initial value) general input/output (pb8) (initial value) general input/output (pb8) (initial value) 1 address output (a18) address output (a18) general input/output (pb8) bit 9?pb7 mode bit (pb7md): selects the function of pin pb7/a17. description bit 9: pb7md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a17) (initial value) general input/output (pb7) (initial value) general input/output (pb7) (initial value) 1 address output (a17) address output (a17) general input/output (pb7) bit 8?pb6 mode bit (pb6md): selects the function of pin pb6/a16. description bit 8: pb6md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 address output (a16) (initial value) general input/output (pb6) (initial value) general input/output (pb6) (initial value) 1 address output (a16) address output (a16) general input/output (pb6) bits 7 and 6?reserved: these bits are always read as 1, and should only be written with 1. bit 5?pb5 mode bit (pb5md): selects the function of pin pb5/tclkb. bit 5: pb5md description 0 general input/output (pb5) (initial value) 1 atu clock input (tclkb)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 487 of 818 rej09b0273-0500 bit 4?pb4 mode bit (pb4md): selects the function of pin pb4/tclka. bit 4: pb4md description 0 general input/output (pb4) (initial value) 1 atu clock input (tclka) bit 3?pb3 mode bit (pb3md): selects the function of pin pb3/to9. bit 3: pb3md description 0 general input/output (pb3) (initial value) 1 atu pwm output (to9) bit 2?pb2 mode bit (pb2md): selects the function of pin pb2/to8. bit 2: pb2md description 0 general input/output (pb2) (initial value) 1 atu pwm output (to8) bit 1?pb1 mode bit (pb1md): selects the function of pin pb1/to7. bit 1: pb1md description 0 general input/output (pb1) (initial value) 1 atu pwm output (to7) bit 0?pb0 mode bit (pb0md): selects the function of pin pb1/to6. bit 0: pb0md description 0 general input/output (pb0) (initial value) 1 atu pwm output (to6)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 488 of 818 rej09b0273-0500 16.3.5 port c io register (pcior) bit:1514131211109876543210 ? pc14 ior pc13 ior pc12 ior pc11 ior pc10 ior pc9 ior pc8 ior pc7 ior pc6 ior pc5 ior pc4 ior pc3 ior pc2 ior pc1 ior pc0 ior initial value:1000000000000000 r/w: r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port c io register (pcior) is a 16-bit readable/writable register that selects the input/output direction of the 15 pins in port c. bits pc14ior to pc0ior correspond to pins pc14/toh10 to pc0/ wrl . pcior is enabled when port c pins function as general input/output pins (pc14 to pc0), and disabled otherwise. when port c pins function as pc14 to pc0, a pin becomes an output when the corresponding bit in pcior is set to 1, and an input when the bit is cleared to 0. pcior is initialized to h'8000 by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. 16.3.6 port c control registers 1 and 2 (pccr1, pccr2) port c control registers 1 and 2 (pccr1, pccr2) are 16-bit readable/writable registers that select the functions of the 15 multiplex pins in port c. pccr1 selects the functions of the pins for the upper 7 bits in port c, and p ccr2 selects the functions of the pins for the lower 8 bits in port c. pccr1 and pccr2 are initialized to h'c000 and h'0bff, respectively, by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. they are not initialized in software standby mode or sleep mode. port c control register 1 (pccr1) bit:1514131211109876543210 ?? pc14 md1 pc14 md0 pc13 md1 pc13 md0 pc12 md1 pc12 md0 pc11 md1 pc11 md0 pc10 md1 pc10 md0 pc9 md1 pc9 md0 pc8 md1 pc8 md0 initial value:1100000000000000 r/w: r r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 489 of 818 rej09b0273-0500 bits 15 and 14?reserved: these bits are always read as 1, and should only be written with 1. bits 13 and 12?pc14 mode bits 1 and 0 (pc14md1, pc14md0): these bits select the function of pin pc14/toh10. bit 13: pc14md1 bit 12: pc14md0 description 0 0 general input/output (pc14) (initial value) 1 atu one-shot pulse output (toh10) 10reserved 1 reserved bits 11 and 10?pc13 mode bits 1 and 0 (pc13md1, pc13md0): these bits select the function of pin pc13/tog10. bit 11: pc13md1 bit 10: pc13md0 description 0 0 general input/output (pc13) (initial value) 1 atu one-shot pulse output (tog10) 10reserved 1 reserved bits 9 and 8?pc12 mode bits 1 and 0 (pc12md1, pc12md0): these bits select the function of pin pc12/tof10/drak1. bit 9: pc12md1 bit 8: pc12md0 description 0 0 general input/output (pc12) (initial value) 1 atu one-shot pulse output (tof10) 10dmac dreq1 acceptance signal output (drak1) 1 reserved
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 490 of 818 rej09b0273-0500 bits 7 and 6?pc11 mode bits 1 and 0 (pc11md1, pc11md0): these bits select the function of pin pc11/toe10/drak0. bit 7: pc11md1 bit 6: pc11md0 description 0 0 general input/output (pc11) (initial value) 1 atu one-shot pulse output (toe10) 10dmac dreq0 acceptance signal output (drak0 ) 1 reserved bits 5 and 4?pc10 mode bits 1 and 0 (pc10md1, pc10md0): these bits select the function of pin pc10/tod10. bit 5: pc10md1 bit 4: pc10md0 description 0 0 general input/output (pc10) (initial value) 1 atu one-shot pulse output (tod10) 10reserved 1 reserved bits 3 and 2?pc9 mode bits 1 and 0 (pc9md1, pc9md0): these bits select the function of pin pc9/toc10. bit 3: pc9md1 bit 2: pc9md0 description 0 0 general input/output (pc9) (initial value) 1 atu one-shot pulse output (toc10) 10reserved 1 reserved
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 491 of 818 rej09b0273-0500 bits 1 and 0?pc8 mode bits 1 and 0 (pc8md1, pc8md0): these bits select the function of pin pc8/tob10. bit 1: pc8md1 bit 0: pc8md0 description 0 0 general input/output (pc8) (initial value) 1 atu one-shot pulse output (tob10) 10reserved 1 reserved port c control register 2 (pccr2) bit:1514131211109876543210 pc7 md1 pc7 md0 pc6 md1 pc6 md0 ? pc5 md ? pc4 md ? pc3 md ? pc2 md ? pc1 md ? pc0 md initial value:0000101111111111 r/w: r/w r/w r/w r/w r r/w r r/w r r/w r r/w r r/w r r/w bits 15 and 14?pc7 mode bits 1 and 0 (pc7md1, pc7md0): these bits select the function of pin pc7/toa10. bit 15: pc7md1 bit 14: pc7md0 description 0 0 general input/output (pc7) (initial value) 1 atu one-shot pulse output (toa10) 10reserved 1 reserved
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 492 of 818 rej09b0273-0500 bits 13 and 12?pc6 mode bits 1 and 0 (pc6md1, pc6md0): these bits select the function of pin pc6/ cs2 / irq6 /adend. description bit 13: pc6md1 bit 12: pc6md0 expanded mode single-chip mode 0 0 general input/output (pc6) (initial value) general input/output (pc6) (initial value) 1 chip select output ( cs2 ) general input/output (pc6) 1 0 interrupt request input ( irq6 ) interrupt request input ( irq6 ) 1 a/d conversion end output (adend) a/d conversion end output (adend) bit 11?reserved: this bit is always read as 1, and should only be written with 1. bit 10?pc5 mode bit (pc5md): selects the function of pin pc5/ cs1 . description bit 10: pc5md expanded mode single-chip mode 0 general input/output (pc5) (initial value) general input/output (pc5) (initial value) 1 chip select output ( cs1 ) general input/output (pc5) bit 9?reserved: this bit is always read as 1, and should only be written with 1. bit 8?pc4 mode bit (pc4md): selects the function of pin pc4/ cs0 . description bit 8: pc4md expanded mode single-chip mode 0 general input/output (pc4) general input/output (pc4) 1 chip select output ( cs0 ) (initial value) general input/output (pc4) (initial value) bit 7?reserved: this bit is always read as 1, and should only be written with 1.
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 493 of 818 rej09b0273-0500 bit 6?pc3 mode bit (pc3md): selects the function of pin pc3/ rd . description bit 6: pc3md expanded mode single-chip mode 0 general input/output (pc3) general input/output (pc3) 1 read output ( rd ) (initial value) general input/output (pc3) (initial value) bit 5?reserved: this bit is always read as 1, and should only be written with 1. bit 4?pc2 mode bit (pc2md): selects the function of pin pc2/ wait . description bit 4: oc2nd expanded mode single-chip mode 0 general input/output (pc2) general input/output (pc2) 1 wait state input ( wait ) (initial value) general input/output (pc2) (initial value) bit 3?reserved: this bit is always read as 1, and should only be written with 1. bit 2?pc1 mode bit (pc1md): selects the function of pin pc1/ wrh . description bit 2: pc1md expanded mode single-chip mode 0 general input/output (pc1) general input/output (pc1) 1 high-end write ( wrh ) (initial value) general input/output (pc1) (initial value) bit 1?reserved: this bit is always read as 1, and should only be written with 1. bit 0?pc0 mode bit (pc0md): selects the function of pin pc0/ wrl . description bit 0: pc0md expanded mode single-chip mode 0 general input/output (pc0) general input/output (pc0) 1 low-end write ( wrl ) (initial value) general input/output (pc0) (initial value)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 494 of 818 rej09b0273-0500 16.3.7 port d io register (pdior) bit:1514131211109876543210 pd15 ior pd14 ior pd13 ior pd12 ior pd11 ior pd10 ior pd9 ior pd8 ior pd7 ior pd6 ior pd5 ior pd4 ior pd3 ior pd2 ior pd1 ior pd0 ior initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port d io register (pdior) is a 16-bit readable/writable register that selects the input/output direction of the 16 pins in port d. bits pd15ior to pd0ior correspond to pins pd15/d15 to pd0/d0. pdior is enabled when port d pins function as general input/output pins (pd15 to pd0), and disabled otherwise. when port d pins function as pd15 to pd0, a pin becomes an output when the corresponding bit in pdior is set to 1, and an input when the bit is cleared to 0. pdior is initialized to h'0000 by a power-on reset (excluding a wdt power-on reset), and in hardware standby wode. it is not initialized in software standby mode or sleep mode. 16.3.8 port d control register (pdcr) bit:1514131211109876543210 pd15 md pd14 md pd13 md pd12 md pd11 md pd10 md pd9 md pd8 md pd7 md pd6 md pd5 md pd4 md pd3 md pd2 md pd1 md pd0 md initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port d control register (pdcr) is a 16-bit readable/writable register that selects the functions of the 16 multiplex pins in port d. pdcr settings are not valid in all operating modes. 1. expanded mode with on-chip rom disabled (area 0: 8-bit bus) port d pins d0 to d7 function as data bus input/output pins, and pdcr settings are invalid. 2. expanded mode with on-chip rom disabled (area 0: 16-bit bus) port d pins function as data bus input/output pins, and pdcr settings are invalid. 3. expanded mode with on-chip rom enabled port d pins are multiplexed as data bus input/output pins and general input/output pins. pdcr settings are valid. 4. single-chip mode port d pins function as general input/output pins, and pdcr settings are invalid.
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 495 of 818 rej09b0273-0500 pdcr is initialized to h'0000 by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. bit 15?pd15 mode bit (pd15md): selects the function of pin pd15/d15. description bit 15: pd15md expanded mode with rom disabled area 0: 8 bits expanded mode with rom disabled area 0: 16 bits expanded mode with rom enabled single-chip mode 0 general input/output (pd15) (initial value) data input/output (d15) (initial value) general input/output (pd15) (initial value) general input/output (pd15) (initial value) 1 data input/output (d15) data input/output (d15) data input/output (d15) general input/output (pd15) bit 14?pd14 mode bit (pd14md): selects the function of pin pd14/d14. description bit 14: pd14md expanded mode with rom disabled area 0: 8 bits expanded mode with rom disabled area 0: 16 bits expanded mode with rom enabled single-chip mode 0 general input/output (pd14) (initial value) data input/output (d14) (initial value) general input/output (pd14) (initial value) general input/output (pd14) (initial value) 1 data input/output (d14) data input/output (d14) data input/output (d14) general input/output (pd14) bit 13?pd13 mode bit (pd13md): selects the function of pin pd13/d13. description bit 13: pd13md expanded mode with rom disabled area 0: 8 bits expanded mode with rom disabled area 0: 16 bits expanded mode with rom enabled single-chip mode 0 general input/output (pd13) (initial value) data input/output (d13) (initial value) general input/output (pd13) (initial value) general input/output (pd13) (initial value) 1 data input/output (d13) data input/output (d13) data input/output (d13) general input/output (pd13)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 496 of 818 rej09b0273-0500 bit 12?pd12 mode bit (pd12md): selects the function of pin pd12/d12. description bit 12: pd12md expanded mode with rom disabled area 0: 8 bits expanded mode with rom disabled area 0: 16 bits expanded mode with rom enabled single-chip mode 0 general input/output (pd12) (initial value) data input/output (d12) (initial value) general input/output (pd12) (initial value) general input/output (pd12) (initial value) 1 data input/output (d12) data input/output (d12) data input/output (d12) general input/output (pd12) bit 11?pd11 mode bit (pd11md): selects the function of pin pd11/d11. description bit 11: pd11md expanded mode with rom disabled area 0: 8 bits expanded mode with rom disabled area 0: 16 bits expanded mode with rom enabled single-chip mode 0 general input/output (pd11) (initial value) data input/output (d11) (initial value) general input/output (pd11) (initial value) general input/output (pd11) (initial value) 1 data input/output (d11) data input/output (d11) data input/output (d11) general input/output (pd11) bit 10?pd10 mode bit (pd10md): selects the function of pin pd10/d10. description bit 10: pd10md expanded mode with rom disabled area 0: 8 bits expanded mode with rom disabled area 0: 16 bits expanded mode with rom enabled single-chip mode 0 general input/output (pd10) (initial value) data input/output (d10) (initial value) general input/output (pd10) (initial value) general input/output (pd10) (initial value) 1 data input/output (d10) data input/output (d10) data input/output (d10) general input/output (pd10)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 497 of 818 rej09b0273-0500 bit 9?pd9 mode bit (pd9md): selects the function of pin pd9/d9. description bit 9: pd9md expanded mode with rom disabled area 0: 8 bits expanded mode with rom disabled area 0: 16 bits expanded mode with rom enabled single-chip mode 0 general input/output (pd9) (initial value) data input/output (d9) (initial value) general input/output (pd9) (initial value) general input/output (pd9) (initial value) 1 data input/output (d9) data input/output (d9) data input/output (d9) general input/output (pd9) bit 8?pd8 mode bit (pd8md): selects the function of pin pd8/d8. description bit 8: pd8md expanded mode with rom disabled area 0: 8 bits expanded mode with rom disabled area 0: 16 bits expanded mode with rom enabled single-chip mode 0 general input/output (pd8) (initial value) data input/output (d8) (initial value) general input/output (pd8) (initial value) general input/output (pd8) (initial value) 1 data input/output (d8) data input/output (d8) data input/output (d8) general input/output (pd8) bit 7?pd7 mode bit (pd7md): selects the function of pin pd7/d7. description bit 7: pd7md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 data input/output (d7) (initial value) general input/output (pd7) (initial value) general input/output (pd7) (initial value) 1 data input/output (d7) data input/output (d7) general input/output (pd7)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 498 of 818 rej09b0273-0500 bit 6?pd6 mode bit (pd6md): selects the function of pin pd6/d6. description bit 6: pd6md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 data input/output (d6) (initial value) general input/output (pd6) (initial value) general input/output (pd6) (initial value) 1 data input/output (d6) data input/output (d6) general input/output (pd6) bit 5?pd5 mode bit (pd5md): selects the function of pin pd5/d5. description bit 5: pd5md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 data input/output (d5) (initial value) general input/output (pd5) (initial value) general input/output (pd5) (initial value) 1 data input/output (d5) data input/output (d5) general input/output (pd5) bit 4?pd4 mode bit (pd4md): selects the function of pin pd4/d4. description bit 4: pd4md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 data input/output (d4) (initial value) general input/output (pd4) (initial value) general input/output (pd4) (initial value) 1 data input/output (d4) data input/output (d4) general input/output (pd4) bit 3?pd3 mode bit (pd3md): selects the function of pin pd3/d3. description bit 3: pd3md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 data input/output (d3) (initial value) general input/output (pd3) (initial value) general input/output (pd3) (initial value) 1 data input/output (d3) data input/output (d3) general input/output (pd3)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 499 of 818 rej09b0273-0500 bit 2?pd2 mode bit (pd2md): selects the function of pin pd2/d2. description bit 2: pd2md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 data input/output (d2) (initial value) general input/output (pd2) (initial value) general input/output (pd2) (initial value) 1 data input/output (d2) data input/output (d2) general input/output (pd2) bit 1?pd1 mode bit (pd1md): selects the function of pin pd1/d1. description bit 1: pd1md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 data input/output (d1) (initial value) general input/output (pd1) (initial value) general input/output (pd1) (initial value) 1 data input/output (d1) data input/output (d1) general input/output (pd1) bit 0?pd0 mode bit (pd0md): selects the function of pin pd0/d0. description bit 0: pd0md expanded mode with rom disabled expanded mode with rom enabled single-chip mode 0 data input/output (d0) (initial value) general input/output (pd0) (initial value) general input/output (pd0) (initial value) 1 data input/output (d0) data input/output (d0) general input/output (pd0)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 500 of 818 rej09b0273-0500 16.3.9 port e io register (peior) bit:1514131211109876543210 ? pe14 ior pe13 ior pe12 ior pe11 ior pe10 ior pe9 ior pe8 ior pe7 ior pe6 ior pe5 ior pe4 ior pe3 ior pe2 ior pe1 ior pe0 ior initial value:1000000000000000 r/w: r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port e io register (peior) is a 16-bit readable/writable register that selects the input/output direction of the 15 pins in port e. bits pe14ior to pe0ior correspond to pins pe14/tioc3 to pe0/tioa1. peior is enabled when port e pins function as general input/output pins (pe14 to pe0) or as atu input/output pins, and disabled otherwise. peior bits 8 to 11 should be cleared to 0 when atu input capture input is selected. when port e pins function as pe14 to pe0, a pin becomes an output when the corresponding bit in peior is set to 1, and an input when the bit is cleared to 0. peior is initialized to h'8000 by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. 16.3.10 port e control register (pecr) bit:1514131211109876543210 ? pe14 md pe13 md pe12 md pe11 md pe10 md pe9 md pe8 md pe7 md pe6 md pe5 md pe4 md pe3 md pe2 md pe1 md pe0 md initial value:1000000000000000 r/w: r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port e control register (pecr) is a 16-bit readable/writable register that selects the functions of the 15 multiplex pins in port e. pecr is initialized to h'8000 by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. bit 15?reserved: this bit is always read as 1, and should only be written with 1.
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 501 of 818 rej09b0273-0500 bit 14?pe14 mode bit (pe14md): selects the function of pin pe14/tioc3. bit 14: pe14md description 0 general input/output (pe14) (initial value) 1 atu input capture input/output compare output (tioc3) bit 13?pe13 mode bit (pe13md): selects the function of pin pe13/tiob3. bit 13: pe13md description 0 general input/output (pe13) (initial value) 1 atu input capture input/output compare output (tiob3) bit 12?pe12 mode bit (pe12md): selects the function of pin pe12/tioa3. bit 12: pe12md description 0 general input/output (pe12) (initial value) 1 atu input capture input/output compare output (tioa3) bit 11?pe11 mode bit (pe11md): selects the function of pin pe11/tid0. bit 11: pe11md description 0 general input/output (pe11) (initial value) 1 atu input capture input (tid0 bit 10?pe10 mode bit (pe10md): selects the function of pin pe10/tic0. bit 10: pe10md description 0 general input/output (pe10) (initial value) 1 atu input capture input (tic0)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 502 of 818 rej09b0273-0500 bit 9?pe9 mode bit (pe9md): selects the function of pin pe9/tib0. bit 9: pe9md description 0 general input/output (pe9) (initial value) 1 atu input capture input (tib0) bit 8?pe8 mode bit (pe8md): selects the function of pin pe8/tia0. bit 8: pe8md description 0 general input/output (pe8) (initial value) 1 atu input capture input (tia0) bit 7?pe7 mode bit (pe7md): selects the function of pin pe7/tiob2. bit 7: pe7md description 0 general input/output (pe7) (initial value) 1 atu input capture input/output compare output (tiob2) bit 6?pe6 mode bit (pe6md): selects the function of pin pe6/tioa2. bit 6: pe6md description 0 general input/output (pe6) (initial value) 1 atu input capture input/output compare output (tioa2) bit 5?pe5 mode bit (pe5md): selects the function of pin pe5/tiof1. bit 5: pe5md description 0 general input/output (pe5) (initial value) 1 atu input capture input/output compare output (tiof1)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 503 of 818 rej09b0273-0500 bit 4?pe4 mode bit (pe4md): selects the function of pin pe4/tioe1. bit 4: pe4md description 0 general input/output (pe4) (initial value) 1 atu input capture input/output compare output (tioe1) bit 3?pe3 mode bit (pe3md): selects the function of pin pe3/tiod1. bit 3: pe3md description 0 general input/output (pe3) (initial value) 1 atu input capture input/output compare output (tiod1) bit 2?pe2 mode bit (pe2md): selects the function of pin pe2/tioc1. bit 2: pe2md description 0 general input/output (pe2) (initial value) 1 atu input capture input/output compare output (tioc1) bit 1?pe1 mode bit (pe1md): selects the function of pin pe1/tiob1. bit 1: pe1md description 0 general input/output (pe1) (initial value) 1 atu input capture input/output compare output (tiob1) bit 0?pe0 mode bit (pe0md): selects the function of pin pe0/tioa1. bit 0: pe0md description 0 general input/output (pe0) (initial value) 1 atu input capture input/output compare output (tioa1)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 504 of 818 rej09b0273-0500 16.3.11 port f io register (pfior) bit:1514131211109876543210 ???? pf11 ior pf10 ior pf9 ior pf8 ior pf7 ior pf6 ior pf5 ior pf4 ior pf3 ior pf2 ior pf1 ior pf0 ior initial value:1111000000000000 r/w:rrrrr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/w the port f io register (pfior) is a 16-bit readable/writable register that selects the input/output direction of the 12 pins in port f. bits pf11ior to pf0ior correspond to pins pf11/ breq /puls7 to pf0/ irq0 . pfior is enabled when port f pins function as general input/output pins (pf11 to pf0) or the pf8/sck2/puls4 pin has the serial clock function (sck2), and is disabled otherwise. when port f pins function as pf11 to pf0 or include the sck2 function, a pin becomes an output when the corresponding bit in pfior is set to 1, and an input when the bit is cleared to 0. pfior is initialized to h'f000 by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. 16.3.12 port f control registers 1 and 2 (pfcr1, pfcr2) port f control registers 1 and 2 (pfcr1, pfcr2) are 16-bit readable/writable registers that select the functions of the 12 multiplex pins in port f. pfcr1 selects the functions of the pins for the upper 4 bits in port f, and pfcr2 selects the functions of the pins for the lower 8 bits in port f. pfcr1 and pfcr2 are initialized to h'ff00 and h'00aa, respectively, by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. they are not initialized in software standby mode or sleep mode.
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 505 of 818 rej09b0273-0500 port f control register 1 (pfcr1) bit:1514131211109876543210 ???????? pf11 md1 pf11 md0 pf10 md1 pf10 md0 pf9 md1 pf9 md0 pf8 md1 pf8 md0 initial value:1111111100000000 r/w:rrrrrrrrr/wr/wr/wr/wr/wr/wr/wr/w bits 15 to 8?reserved: these bits are always read as 1, and should only be written with 1. bits 7 and 6?pf11 mode bits 1 and 0 (pf11md1, pf11md0): these bits select the function of pin pf11/ breq /puls7. description bit 7: pf11md1 bit 6: pf11md0 expanded mode single-chip mode 0 0 general input/output (pf11) (initial value) general input/output (pf11) (initial value) 1 bus request input ( breq ) general input/output (pf11) 1 0 apc pulse output (puls7) apc pulse output (puls7) 1 reserved reserved bits 5 and 4?pf10 mode bits 1 and 0 (pf10md1, pf10md0): these bits select the function of pin pf10/ back /puls6. description bit 5: pf10md1 bit 4: pf10md0 expanded mode single-chip mode 0 0 general input/output (pf10) (initial value) general input/output (pf10) (initial value) 1 bus request acknowledge output ( back ) general input/output (pf10) 1 0 apc pulse output (puls6) apc pulse output (puls6) 1 reserved reserved
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 506 of 818 rej09b0273-0500 bits 3 and 2?pf9 mode bits 1 and 0 (pf9md1, pf9md0): these bits select the function of pin pf9/ cs3 / irq7 /puls5. description bit 3: pf9md1 bit 2: pf9md0 expanded mode single-chip mode 0 0 general input/output (pf9) (initial value) general input/output (pf9) (initial value) 1 chip select output ( cs3 ) general input/output (pf9) 1 0 interrupt request input ( irq7 ) interrupt request input ( irq7 ) 1 apc pulse output (puls5) apc pulse output (puls5) bits 1 and 0?pf8 mode bits 1 and 0 (pf8md1, pf8md0): these bits select the function of pin pf8/sck/puls4. bit 1: pf8md1 bit 0: pf8md0 description 0 0 general input/output (pf8) (initial value) 1 serial clock input/output (sck2) 1 0 apc pulse output (puls4) 1 reserved
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 507 of 818 rej09b0273-0500 port f control register 2 (pfcr2) bit:1514131211109876543210 pf7 md1 pf7 md0 pf6 md1 pf6 md0 pf5 md1 pf5 md0 pf4 md1 pf4 md0 ? pf3 md ? pf2 md ? pf1 md ? pf0 md initial value:0000000010101010 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r r/w r r/w r r/w r r/w bits 15 and 14?pf7 mode bits 1 and 0 (pf7md1, pf7md0): these bits select the function of pin pf7/ dreq0 /puls3. bit 15: pf7md1 bit 14: pf7md0 description 0 0 general input/output (pf7) (initial value) 1 dma transfer request input ( dreq0 ) 1 0 apc pulse output (puls3) 1 reserved bits 13 and 12?pf6 mode bits 1 and 0 (pf6md1, pf6md0): these bits select the function of pin pf6/dack0/puls2. description bit 13: pf6md1 bit 12: pf6md0 expanded mode single-chip mode 0 0 general input/output (pf6) (initial value) general input/output (pf6) 1 dma transfer request acceptance output (dack0) general input/output (pf6) 1 0 apc pulse output (puls2) apc pulse output (puls2) 1 reserved reserved
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 508 of 818 rej09b0273-0500 bits 11 and 10?pf5 mode bits 1 and 0 (pf5md1, pf5md0): these bits select the function of pin pf5/ dreq1 /puls1. bit 11: pf5md1 bit 10: pf5md0 description 0 0 general input/output (pf5) (initial value) 1 dma transfer request input ( dreq1 ) 1 0 apc pulse output (puls1) 1 reserved bits 9 and 8?pf4 mode bits 1 and 0 (pf4md1, pf4md0): these bits select the function of pin pf4/dack1/puls0. description bit 9: pf4md1 bit 8: pf4md0 expanded mode single-chip mode 0 0 general input/output (pf4) (initial value) general input/output (pf4) 1 dma transfer request acceptance output (dack1) general input/output (pf4) 1 0 apc pulse output (puls0) apc pulse output (puls0) 1 reserved reserved bit 7?reserved: this bit is always read as 1, and should only be written with 1. bit 6?pf3 mode bit (pf3md): selects the function of pin pf3/ irq3 . bit 6: pe3md description 0 general input/output (pf3) (initial value) 1 interrupt request input ( irq3 ) bit 5?reserved: this bit is always read as 1, and should only be written with 1.
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 509 of 818 rej09b0273-0500 bit 4?pf2 mode bit (pf2md): selects the function of pin pf2/ irq2 . bit 4: pe2md description 0 general input/output (pf2) (initial value) 1 interrupt request input ( irq2 ) bit 3?reserved: this bit is always read as 1, and should only be written with 1. bit 2?pf1 mode bit (pf1md): selects the function of pin pf1/ irq1 . bit 2: pe1md description 0 general input/output (pf1) (initial value) 1 interrupt request input ( irq1 ) bit 1?reserved: this bit is always read as 1, and should only be written with 1. bit 0?pf0 mode bit (pf0md): selects the function of pin pf0/ irq0 . bit 0: pe0md description 0 general input/output (pf0) (initial value) 1 interrupt request input ( irq0 )
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 510 of 818 rej09b0273-0500 16.3.13 port g io register (pgior) bit:1514131211109876543210 pg1 5 ior pg1 4 ior pg1 3 ior pg1 2 ior pg1 1 ior pg1 0 ior pg9 ior pg8 ior pg7 ior pg6 ior pg5 ior pg4 ior pg3 ior pg2 ior pg1 ior pg0 ior initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port g io register (pgior) is a 16-bit readable/writable register that selects the input/output direction of the 16 pins in port g. bits pg15ior to pg0ior correspond to pins pg15/irq5/tiob5 to pg0/adtrg/irqout. pgior is enabled when port g pins function as general input/output pins (pg15 to pg0), serial clock pins (sck1, sck0), or timer input/output pins (tiod3, tioa4, tiob4, tioc4, tiod4, tioa5, tiob5), and is disabled otherwise. when port g pins function as pg15 to pg0, sck1 and sck0, or tiod3, tioa4, tiob4, tioc4, tiod4, tioa5, and tiob5, a pin becomes an output when the corresponding bit in pgior is set to 1, and an input when the bit is cleared to 0. pgior is initialized to h'0000 by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. 16.3.14 port g control registers 1 and 2 (pgcr1, pgcr2) port g control registers 1 and 2 (pgcr1, pgcr2) are 16-bit readable/writable registers that select the functions of the 16 multiplex pins in port g. pgcr1 selects the functions of the pins for the upper 8 bits in port g, and pgcr2 selects the functions of the pins for the lower 8 bits in port g. pgcr1 and pgcr2 are initialized to h'0aaa and h'aa80, respectively, by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. they are not initialized in software standby mode or sleep mode.
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 511 of 818 rej09b0273-0500 port g control register 1 (pgcr1) bit:1514131211109876543210 pg15 md1 pg15 md0 pg14 md1 pg14 md0 ? pg13 md0 ? pg12 md0 ? pg11 md ? pg10 md ? pg9 md ? pg8 md initial value:0000101010101010 r/w: r/w r/w r/w r/w r r/w r r/w r r/w r r/w r r/w r r/w bits 15 and 14?pg15 mode bits 1 and 0 (pg15md1, pg15md0): these bits select the function of pin pg15/ irq5 /tiob5. bit 15: pg15md1 bit 14: pg15md0 description 0 0 general input/output (pg15) (initial value) 1 interrupt request input ( irq5 ) 1 0 atu input capture input/output compare output (tiob5) 1 reserved bits 13 and 12?pg14 mode bits 1 and 0 (pg14md1, pg14md0): these bits select the function of pin pg14/ irq4 /tioa5. bit 13: pg14md1 bit 12: pg14md0 description 0 0 general input/output (pg14) (initial value) 1 interrupt request input ( irq4 ) 1 0 atu input capture input/output compare output (tioa5) 1 reserved bit 11?reserved: this bit is always read as 1, and should only be written with 1. bit 10?pg13 mode bit (pg13md): selects the function of pin pg13/tiod4. bit 10: pg13md description 0 general input/output (pg13) (initial value) 1 atu input capture input/output compare output (tiod4) bit 9?reserved: this bit is always read as 1, and should only be written with 1.
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 512 of 818 rej09b0273-0500 bit 8?pg12 mode bit (pg12md): selects the function of pin pg12/tioc4. bit 8: pg12md description 0 general input/output (pg12) (initial value) 1 atu input capture input/output compare output (tioc4) bit 7?reserved: this bit is always read as 1, and should only be written with 1. bit 6?pg11 mode bit (pg11md): selects the function of pin pg11/tiob4. bit 6: pg11md description 0 general input/output (pg11) (initial value) 1 atu input capture input/output compare output (tiob4) bit 5?reserved: this bit is always read as 1, and should only be written with 1. bit 4?pg10 mode bit (pg10md): selects the function of pin pg10/tioa4. bit 4: pg10md description 0 general input/output (pg10) (initial value) 1 atu input capture input/output compare output (tioa4) bit 3?reserved: this bit is always read as 1, and should only be written with 1. bit 2?pg9 mode bit (pg9md): selects the function of pin pg9/tiod3. bit 2: pg9md description 0 general input/output (pg9) (initial value) 1 atu input capture input/output compare output (tiod3) bit 1?reserved: this bit is always read as 1, and should only be written with 1.
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 513 of 818 rej09b0273-0500 bit 0?pg8 mode bit (pg8md): selects the function of pin pg8/rxd2. bit 0: pg8md description 0 general input/output (pg8) (initial value) 1 receive data input (rxd2) port g control register 2 (pgcr2) bit:1514131211109876543210 ? pg7 md0 ? pg6 md0 ? pg5 md ? pg4 md ? pg3 md pg2 md pg1 md pg0 md1 pg0 md0 irq md1 irq md0 initial value:1010101010000000 r/w: r r/w r r/w r r/w r r/w r r/w r/w r/w r/w r/w r/w r/w bit 15?reserved: this bit is always read as 1, and should only be written with 1. bit 14?pg7 mode bit (pg7md): selects the function of pin pg7/txd2. bit 14: pg7md description 0 general input/output (pg7) (initial value) 1 transmit data output (txd2) bit 13?reserved: this bit is always read as 1, and should only be written with 1. bit 12?pg6 mode bit (pg6md): selects the function of pin pg6/rxd1. bit 12: pg6md description 0 general input/output (pg6) (initial value) 1 receive data input (rxd1) bit 11?reserved: this bit is always read as 1, and should only be written with 1.
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 514 of 818 rej09b0273-0500 bit 10?pg5 mode bit (pg5md): selects the function of pin pg5/txd1. bit 10: pg5md description 0 general input/output (pg5) (initial value) 1 transmit data output (txd1) bit 9?reserved: this bit is always read as 1, and should only be written with 1. bit 8?pg4 mode bit (pg4md): selects the function of pin pg4/sck1. bit 8: pg4md description 0 general input/output (pg4) (initial value) 1 serial clock input/output (sck1) bit 7?reserved: this bit is always read as 1, and should only be written with 1. bit 6?pg3 mode bit (pg3md): selects the function of pin pg3/rxd0. bit 6: pg3md description 0 general input/output (pg3) (initial value) 1 receive data input (rxd0) bit 5?pg2 mode bit (pg2md): selects the function of pin pg2/txd0. bit 5: pg2md description 0 general input/output (pg2) (initial value) 1 transmit data output (txd0)
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 515 of 818 rej09b0273-0500 bit 4?pg1 mode bit (pg1md): selects the function of pin pg1/sck0. bit 4: pg1md description 0 general input/output (pg1) (initial value) 1 serial clock input/output (sck0) bits 3 and 2?pg0 mode bits 1 and 0 (pg0md1, pg0md0): these bits select the function of pin pg0/ adtrg / irqout . bit 3: pg0md1 bit 2: pg0md0 description 0 0 general input/output (pg0) (initial value) 1 a/d conversion trigger input ( adtrg ) 1 0 interrupt request output ( irqout ) 1 reserved bits 1 and 0? irqout irqout irqout irqout mode bits 1 and 0 (irqmd1, irqmd0): these bits select the irqout function for pin pg0/ adtrg / irqout . bit 1: irqmd1 bit 0: irqmd0 description 00 irqout is always high (initial value) 1 output on intc interrupt request 10reserved 1 reserved
section 16 pin function controller (pfc) rev. 5.00 jan 06, 2006 page 516 of 818 rej09b0273-0500 16.3.15 ck control register (ckcr) ck control register (ckcr) is a 16-bit readable/writable register being used for controlling clock output from ck terminal. ckcr is initialized to h'fffe by a power-on reset and in hardware standby mode. it is not initialized in software standby mode or sleep mode. bit:1514131211109876543210 ??????????????? cklo initial value:1111111111111110 r/w:rrrrrrrrrrrrrrrr/w bits 15 to 1?reserved: this bit is always read as 1, and should only be written with 1. bit 0?ck low fixed bit (cklo): this bit is used for selecting the internal clock output or low level output for output from the ck terminal. bit 0: cklo description 0 selects the internal clock for the ck terminal output (initial value) 1 always selects the low level for the ck terminal output
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 517 of 818 rej09b0273-0500 section 17 i/o ports (i/o) 17.1 overview the sh7050 series has eight ports: a, b, c, d, e, f, g, and h. ports a to g are input/output ports (a: 16 bits, b: 12 bits, c: 15 bits, d: 16 bits, e: 15 bits, f: 12 bits, g: 16 bits), and h is a 16-bit input port. all the port pins are multiplexed as general input/output pins (general input pins in the case of port h) and special function pins. the functions of the multiplex pins are selected by means of the pin function controller (pfc). each port is provided with a data register for storing the pin data. 17.2 port a port a is an input/output port with the 16 pins shown in figure 17.1. expanded mode with rom disabled expanded mode with rom enabled single-chip mode a15 (output) a14 (output) a13 (output) a12 (output) a11 (output) a10 (output) a9 (output) a8 (output) a7 (output) a6 (output) a5 (output) a4 (output) a3 (output) a2 (output) a1 (output) a0 (output) pa15 (input/output)/a15 (output) pa14 (input/output)/a14 (output) pa13 (input/output)/a13 (output) pa12 (input/output)/a12 (output) pa11 (input/output)/a11 (output) pa10 (input/output)/a10 (output) pa9 (input/output)/a9 (output) pa8 (input/output)/a8 (output) pa7 (input/output)/a7 (output) pa6 (input/output)/a6 (output) pa5 (input/output)/a5 (output) pa4 (input/output)/a4 (output) pa3 (input/output)/a3 (output) pa2 (input/output)/a2 (output) pa1 (input/output)/a1 (output) pa0 (input/output)/a0 (output) pa15 (input/output) pa14 (input/output) pa13 (input/output) pa12 (input/output) pa11 (input/output) pa10 (input/output) pa9 (input/output) pa8 (input/output) pa7 (input/output) pa6 (input/output) pa5 (input/output) pa4 (input/output) pa3 (input/output) pa2 (input/output) pa1 (input/output) pa0 (input/output) port a figure 17.1 port a
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 518 of 818 rej09b0273-0500 17.2.1 register configuration the port a register is shown in table 17.1. table 17.1 port a register name abbreviation r/w initial value address access size port a data register padr r/w h'0000 h'ffff8380 8, 16 note: a register access is performed in two cycles regardless of the access size. 17.2.2 port a data register (padr) bit:1514131211109876543210 pa15 dr pa14 dr pa13 dr pa12 dr pa11 dr pa10 dr pa9 dr pa8 dr pa7 dr pa6 dr pa5 dr pa4 dr pa3 dr pa2 dr pa1 dr pa0 dr initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port a data register (padr) is a 16-bit readable/writable register that stores port a data. bits pa15dr to pa0dr correspond to pins pa15/a15 to pa0/a0. when a pin functions as a general output, if a value is written to padr, that value is output directly from the pin, and if padr is read, the register value is returned directly regardless of the pin state. when the pod pin is driven low, general outputs go to the high-impedance state regardless of the padr value. when the pod pin is driven high, the written value is output from the pin. when a pin functions as a general input, if padr is read the pin state, not the register value, is returned directly. if a value is written to padr, although that value is written into padr it does not affect the pin state. table 17.2 summarizes port a data register read/write operations. padr is initialized by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode.
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 519 of 818 rej09b0273-0500 table 17.2 port a data register (padr) read/write operations paior pin function read write 0 general input pin state value is written to padr, but does not affect pin state other than general input pin state value is written to padr, but does not affect pin state 1 general output padr value write value is output from pin ( pod pin = high) high impedance regardless of padr value ( pod pin = low) other than general output padr value value is written to padr, but does not affect pin state 17.3 port b port b is an input/output port with the 12 pins shown in figure 17.2. expanded mode with rom disabled expanded mode with rom enabled single-chip mode a20 (output) a19 (output) a18 (output) a17 (output) a16 (output) pb5 (input/output)/tclkb (input) pb4 (input/output)/tclka (input) pb3 (input/output)/to9 (output) pb2 (input/output)/to8 (output) pb1 (input/output)/to7 (output) pb0 (input/output)/to6 (output) pb10 (input/output)/a20 (output) pb9 (input/output)/a19 (output) pb8 (input/output)/a18 (output) pb7 (input/output)/a17 (output) pb6 (input/output)/a16 (output) pb10 (input/output) pb9 (input/output) pb8 (input/output) pb7 (input/output) pb6 (input/output) port b a21 (output) pb11 (input/output)/ a21 (output)/ pod (input) pb11 (input/output)/ pod (input) figure 17.2 port b
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 520 of 818 rej09b0273-0500 17.3.1 register configuration the port b register is shown in table 17.3. table 17.3 port b register name abbreviation r/w initial value address access size port b data register pbdr r/w h'c0c0 h'ffff8386 8, 16 note: a register access is performed in two cycles regardless of the access size. 17.3.2 port b data register (pbdr) bit:1514131211109876543210 ?? pb11 dr pb10 dr pb9 dr pb8 dr pb7 dr pb6 dr ?? pb5 dr pb4 dr pb3 dr pb2 dr pb1 dr pb0 dr initial value:1100000011000000 r/w: r r r/w r/w r/w r/w r/w r/w r r r/w r/w r/w r/w r/w r/w the port b data register (pbdr) is a 16-bit readable/writable register that stores port b data. bits pb11dr to pb0dr correspond to pins pb11/a21/ pod to pb0/to6. when a pin functions as a general output, if a value is written to pbdr, that value is output directly from the pin, and if pbdr is read, the register value is returned directly regardless of the pin state. for pb6 to pb10, when the pod pin is driven low, general outputs go to the high- impedance state regardless of the pbdr value. when the pod pin is driven high, the written value is output from the pin. when a pin functions as a general input, if pbdr is read the pin state, not the register value, is returned directly. if a value is written to pbdr, although that value is written into pbdr it does not affect the pin state. table 17.4 summarizes port b data register read/write operations. pbdr is initialized by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode.
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 521 of 818 rej09b0273-0500 table 17.4 port b data register (pbdr) read/write operations (bits 8 to 12) pbior pin function read write 0 general input pin state value is written to pbdr, but does not affect pin state other than general input pin state value is written to pbdr, but does not affect pin state 1 general output pbdr value write value is output from pin ( pod pin = high) high impedance regardless of pbdr value ( pod pin = low) other than general output pbdr value value is written to pbdr, but does not affect pin state (bits other than 8 to 12) pbior pin function read write 0 general input pin state value is written to pbdr, but does not affect pin state other than general input pin state value is written to pbdr, but does not affect pin state 1 general output pbdr value write value is output from pin other than general output pbdr value value is written to pbdr, but does not affect pin state
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 522 of 818 rej09b0273-0500 17.4 port c port c is an input/output port with the 15 pins shown in figure 17.3. expanded mode single-chip mode pc14 (input/output)/toh10 (output) pc13 (input/output)/tog10 (output) pc12 (input/output)/tof10 (output)/drak1 (output) pc11 (input/output)/toe10 (output)/drak0 (output) pc10 (input/output)/tod10 (output) pc9 (input/output)/toc10 (output) pc87 (input/output)/tob10 (output) pc7 (input/output)/toa10 (output) pc5 (input/output)/ cs1 (output) pc4 (input/output)/ cs0 (output) pc3 (input/output)/ rd (output) pc2 (input/output)/ wait (input) pc1 (input/output)/ wrh (output) pc0 (input/output)/ wrl (output) pc5 (input/output) pc4 (input/output) pc3 (input/output) pc2 (input/output) pc1 (input/output) pc0 (input/output) port c pc6 (input/output)/ cs2 (output)/ irq6 (input)/adend (output) pc6 (input/output)/ irq6 (input)/ adend (output) figure 17.3 port c 17.4.1 register configuration the port c register is shown in table 17.5. table 17.5 port c register name abbreviation r/w initial value address access size port c data register pcdr r/w h'8000 h'ffff8390 8, 16 note: a register access is performed in two cycles regardless of the access size.
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 523 of 818 rej09b0273-0500 17.4.2 port c data register (pcdr) bit:1514131211109876543210 ? pc14 dr pc13 dr pc12 dr pc11 dr pc10 dr pc9 dr pc8 dr pc7 dr pc6 dr pc5 dr pc4 dr pc3 dr pc2 dr pc1 dr pc0 dr initial value:1000000000000000 r/w: r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port c data register (pcdr) is a 16-bit readable/writable register that stores port c data. bits pc14dr to pc0dr correspond to pins pc14/toh10 to pc0/ wrl . when a pin functions as a general output, if a value is written to pcdr, that value is output directly from the pin, and if pcdr is read, the register value is returned directly regardless of the pin state. when a pin functions as a general input, if pcdr is read the pin state, not the register value, is returned directly. if a value is written to pcdr, although that value is written into pcdr it does not affect the pin state. table 17.6 summarizes port c data register read/write operations. pcdr is initialized by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. table 17.6 port c data register (pcdr) read/write operations pcior pin function read write 0 general input pin state value is written to pcdr, but does not affect pin state other than general input pin state value is written to pcdr, but does not affect pin state 1 general output pcdr value write value is output from pin other than general output pcdr value value is written to pcdr, but does not affect pin state
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 524 of 818 rej09b0273-0500 17.5 port d port d is an input/output port with the 16 pins shown in figure 17.4. expanded mode with rom enabled pd15 (input/output)/ d15 (input/output) pd14 (input/output)/ d14 (input/output) pd13 (input/output)/ d13 (input/output) pd12 (input/output)/ d12 (input/output) pd11 (input/output)/ d11 (input/output) pd10 (input/output)/ d10 (input/output) pd9 (input/output)/ d9 (input/output) pd8 (input/output)/ d8 (input/output) pd7 (input/output)/ d7 (input/output) pd6 (input/output)/ d6 (input/output) pd5 (input/output)/ d5 (input/output) pd4 (input/output)/ d4 (input/output) pd3 (input/output)/ d3 (input/output) pd2 (input/output)/ d2 (input/output) pd2 (input/output)/ d1 (input/output) pd0 (input/output)/ d0 (input/output) pd15 (input/output)/ d15 (input/output) pd14 (input/output)/ d14 (input/output) pd13 (input/output)/ d13 (input/output) pd12 (input/output)/ d12 (input/output) pd11 (input/output)/ d11 (input/output) pd10 (input/output)/ d10 (input/output) pd9 (input/output)/ d9 (input/output) pd8 (input/output)/ d8 (input/output) d7 (input/output) d6 (input/output) d5 (input/output) d4 (input/output) d3 (input/output) d2 (input/output) d1 (input/output) d0 (input/output) pd7 (input/output) pd6 (input/output) pd5 (input/output) pd4 (input/output) pd3 (input/output) pd2 (input/output) pd1 (input/output) pd0 (input/output) d15 (input/output) d14 (input/output) d13 (input/output) d12 (input/output) d11 (input/output) d10 (input/output) d9 (input/output) d8 (input/output) pd15 (input/output) pd14 (input/output) pd13 (input/output) pd12 (input/output) pd11 (input/output) pd10 (input/output) pd9 (input/output) pd8 (input/output) expanded mode with rom disabled (area 0: 8 bits) expanded mode with rom disabled (area 0: 16 bits) single-chip mode port d figure 17.4 port d
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 525 of 818 rej09b0273-0500 17.5.1 register configuration the port d register is shown in table 17.7. table 17.7 port d register name abbreviation r/w initial value address access size port d data register pddr r/w h'0000 h'ffff8398 8, 16 note: a register access is performed in two cycles regardless of the access size. 17.5.2 port d data register (pddr) bit:1514131211109876543210 pd15 dr pd14 dr pd13 dr pd12 dr pd11 dr pd10 dr pd9 dr pd8 dr pd7 dr pd6 dr pd5 dr pd4 dr pd3 dr pd2 dr pd1 dr pd0 dr initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port d data register (pddr) is a 16-bit readable/writable register that stores port d data. bits pd15dr to pd0dr correspond to pins pd15/d15 to pd0/d0. when a pin functions as a general output, if a value is written to pddr, that value is output directly from the pin, and if pddr is read, the register value is returned directly regardless of the pin state. when the pod pin is driven low, general outputs go to the high-impedance state regardless of the pddr value. when the pod pin is driven high, the written value is output from the pin. when a pin functions as a general input, if pddr is read the pin state, not the register value, is returned directly. if a value is written to pddr, although that value is written into pddr it does not affect the pin state. table 17.8 summarizes port d data register read/write operations. pddr is initialized by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode.
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 526 of 818 rej09b0273-0500 table 17.8 port d data register (pddr) read/write operations pdior pin function read write 0 general input pin state value is written to pddr, but does not affect pin state other than general input pin state value is written to pddr, but does not affect pin state 1 general output pddr value write value is output from pin ( pod pin = high) high impedance regardless of pddr value ( pod pin = low) other than general output pddr value value is written to pddr, but does not affect pin state
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 527 of 818 rej09b0273-0500 17.6 port e port e is an input/output port with the 15 pins shown in figure 17.5. pe14 (input/output)/tioc3 (input/output) pe13 (input/output)/tiob3 (input/output) pe12 (input/output)/tioa3 (input/output) pe11 (input/output)/tid0 (input) pe10 (input/output)/tic0 (input) pe9 (input/output)/tib0 (input) pe8 (input/output)/tia0 (input) pe8 (input/output)/tiob2 (input/output) pe6 (input/output)/tioa2 (input/output) pe5 (input/output)/tiof1 (input/output) pe4 (input/output)/tioe1 (input/output) pe3 (input/output)/tiod1 (input/output) pe2 (input/output)/tioc1 (input/output) pe1 (input/output)/tiob1 (input/output) pe0 (input/output)/tioa1 (input/output) port e figure 17.5 port e 17.6.1 register configuration the port e register is shown in table 17.9. table 17.9 port e register name abbreviation r/w initial value address access size port e data register pedr r/w h'8000 h'ffff83a0 8, 16 note: a register access is performed in two cycles regardless of the access size.
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 528 of 818 rej09b0273-0500 17.6.2 port e data register (pedr) bit:1514131211109876543210 ? pe14 dr pe13 dr pe12 dr pe11 dr pe10 dr pe9 dr pe8 dr pe7 dr pe6 dr pe5 dr pe4 dr pe3 dr pe2 dr pe1 dr pe0 dr initial value:1000000000000000 r/w: r r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port e data register (pedr) is a 16-bit readable/writable register that stores port e data. bits pe14dr to pe0dr correspond to pins pe14/tioc3 to pe0/tioa1. when a pin functions as a general output, if a value is written to pedr, that value is output directly from the pin, and if pedr is read, the register value is returned directly regardless of the pin state. when a pin functions as a general input, if pedr is read the pin state, not the register value, is returned directly. if a value is written to pedr, although that value is written into pedr it does not affect the pin state. table 17.10 summarizes port e data register read/write operations. pedr is initialized by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. table 17.10 port e data register (pedr) read/write operations peior pin function read write 0 general input pin state value is written to pedr, but does not affect pin state other than general input pin state value is written to pedr, but does not affect pin state 1 general output pedr value write value is output from pin other than general output pedr value value is written to pedr, but does not affect pin state
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 529 of 818 rej09b0273-0500 17.7 port f port f is an input/output port with the 12 pins shown in figure 17.6. expanded mode single-chip mode pf11 (input/output)/ breq (input)/puls7 (output) pf10 (input/output)/ back (output)/puls6 (output) pf8 (input/output)/sck2 (output)/puls4 (output) pf7 (input/output)/ dreq0 (input)/puls3 (output) pf6 (input/output)/dack0 (output)/puls2 (output) pf5 (input/output)/ dreq1 (input)/puls1 (output) pf4 (input/output)/dack1 (output)/puls0 (output) pf3 (input/output)/ irq3 (input) pf2 (input/output)/ irq2 (input) pf1 (input/output)/ irq1 (input) pf0 (input/output)/ irq0 (input) pf11 (input/output)/puls7 (output) pf10 (input/output)/puls6 (output) pf6 (input/output)/puls2 (output) pf4 (input/output)/puls0 (output) port f pf9 (input/output)/ irq7 (input)/ puls5 (output) pf9 (input/output)/ cs3 (output)/ irq7 (input)/ puls5 (output) figure 17.6 port f 17.7.1 register configuration the port f register is shown in table 17.11. table 17.11 port f register name abbreviation r/w initial value address access size port f data register pfdr r/w h'f000 h'ffff83a6 8, 16 note: a register access is performed in two cycles regardless of the access size.
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 530 of 818 rej09b0273-0500 17.7.2 port f data register (pfdr) bit:1514131211109876543210 ???? pf11 dr pf10 dr pf9 dr pf8 dr pf7 dr pf6 dr pf5 dr pf4 dr pf3 dr pf2 dr pf1 dr pf0 dr initial value:1111000000000000 r/w:rrrrr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/wr/w the port f data register (pfdr) is a 16-bit readable/writable register that stores port f data. bits pf11dr to pf0dr correspond to pins pf11/ breq/ puls7 to pf0/ irq0 . when a pin functions as a general output, if a value is written to pfdr, that value is output directly from the pin, and if pfdr is read, the register value is returned directly regardless of the pin state. when a pin functions as a general input, if pfdr is read the pin state, not the register value, is returned directly. if a value is written to pfdr, although that value is written into pfdr it does not affect the pin state. table 17.12 summarizes port f data register read/write operations. pfdr is initialized by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. table 17.12 port f data register (pfdr) read/write operations pfior pin function read write 0 general input pin state value is written to pfdr, but does not affect pin state other than general input pin state value is written to pfdr, but does not affect pin state 1 general output pfdr value write value is output from pin other than general output pfdr value value is written to pfdr, but does not affect pin state
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 531 of 818 rej09b0273-0500 17.8 port g port g is an input/output port with the 16 pins shown in figure 17.7. pg15 (input/output)/ irq5 (input)/tiob5 (input/output) pg14 (input/output)/ irq4 (input)/tioa5 (input/output) pg13 (input/output)/tiod4 (input/output) pg12 (input/output)/tioc4 (input/output) pg11 (input/output)/tiob4 (input/output) pg10 (input/output)/tioa4 (input/output) pg9 (input/output)/tiod3 (input/output) pg8 (input/output)/rxd2 (input) pg7 (input/output)/txd2 (output) pg6 (input/output)/rxd1 (input) pg5 (input/output)/txd1 (output) pg4 (input/output)/sck1 (input/output) pg3 (input/output)/rxd0 (input) pg2 (input/output)/txd0 (output) pg1 (input/output)/sck0 (input/output) pg0 (input/output)/ adtrg (input)/ irqout (output) port g figure 17.7 port g 17.8.1 register configuration the port g register is shown in table 17.13. table 17.13 port g register name abbreviation r/w initial value address access size port g data register pgdr r/w h'0000 h'ffff83ae 8, 16 note: a register access is performed in two cycles regardless of the access size.
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 532 of 818 rej09b0273-0500 17.8.2 port g data register (pgdr) bit:1514131211109876543210 pg15 dr pg14 dr pg13 dr pg12 dr pg11 dr pg10 dr pg9 dr pg8 dr pg7 dr pg6 dr pg5 dr pg4 dr pg3 dr pg2 dr pg1 dr pg0 dr initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w the port g data register (pgdr) is a 16-bit readable/writable register that stores port g data. bits pg15dr to pg0dr correspond to pins pg15/tiob5/ irq5 to pg0/ adtrg / irqout . when a pin functions as a general output, if a value is written to pgdr, that value is output directly from the pin, and if pgdr is read, the register value is returned directly regardless of the pin state. when a pin functions as a general input, if pgdr is read the pin state, not the register value, is returned directly. if a value is written to pgdr, although that value is written into pgdr it does not affect the pin state. table 17.14 summarizes port g data register read/write operations. pgdr is initialized by a power-on reset (excluding a wdt power-on reset), and in hardware standby mode. it is not initialized in software standby mode or sleep mode. table 17.14 port g data register (pgdr) read/write operations pgior pin function read write 0 general input pin state value is written to pgdr, but does not affect pin state other than general input pin state value is written to pgdr, but does not affect pin state 1 general output pgdr value write value is output from pin other than general output pgdr value value is written to pgdr, but does not affect pin state
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 533 of 818 rej09b0273-0500 17.9 port h port h is an input port with the 16 pins shown in figure 17.8. ph15 (input)/an15 (input) ph14 (input)/an14 (input) ph13 (input)/an13 (input) ph12 (input)/an12 (input) ph11 (input)/an11 (input) ph10 (input)/an10 (input) ph9 (input)/an9 (input) ph8 (input)/an8 (input) ph7 (input)/an7 (input) ph6 (input)/an6 (input) ph5 (input)/an5 (input) ph4 (input)/an4 (input) ph3 (input)/an3 (input) ph2 (input)/an2 (input) ph1 (input)/an1 (input) ph0 (input)/an0 (input) port h figure 17.8 port h 17.9.1 register configuration the port h register is shown in table 17.15. table 17.15 port h register name abbreviation r/w initial value address access size port h data register phdr r undefined h'ffff83b6 8, 16 note: a register access is performed in two cycles regardless of the access size.
section 17 i/o ports (i/o) rev. 5.00 jan 06, 2006 page 534 of 818 rej09b0273-0500 17.9.2 port h data register (phdr) bit:1514131211109876543210 ph15 dr ph14 dr ph13 dr ph12 dr ph11 dr ph10 dr ph9 dr ph8 dr ph7 dr ph6 dr ph5 dr ph4 dr ph3 dr ph2 dr ph1 dr ph0 dr initial value:0000000000000000 r/w:rrrrrrrrrrrrrrrr the port h data register (phdr) is a 16-bit read-only register that stores port h data. bits ph15dr to ph0dr correspond to pins ph15/an15 to ph0/an0. writes to these bits are ignored, and do not affect the pin states. when these bits are read, the pin state, not the register value, is returned directly. however, 1 will be returned while a/d converter analog input is being sampled. table 17.16 summarizes port h data register read/write operations. phdr is not initialized by a power-on reset, or in hardware standby mode, software standby mode, or sleep mode. (the bits always reflect the pin states.) table 17.16 port h data register (phdr) read/write operations pin input/output pin function read write input general input pin state is read ignored (does not affect pin state) ann 1 is read ignored (does not affect pin state) n = 0 to 15 17.10 pod (port output disable) the output port drive buffers for the address bus pins (a20 to a0) and data bus pins (d15 to d0) can be controlled by the pod (port output disable) pin input level. however, this function is enabled only when the address bus pins (a20 to a0) and data bus pins (d15 to d0) are designated as general output ports. output buffer control by means of pod is performed asynchronously from bus cycles. pod pod pod pod address bus pins (a20 to a0) and data bus pins (d15 to d0) (when designated as output ports) 0 enabled (high-impedance) 1 disabled (general output)
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 535 of 818 rej09b0273-0500 section 18 rom (128 kb version) 18.1 features the sh7050 has 128 kbytes of on-chip flash memory. the features of the flash memory are summarized below. ? four flash memory operating modes ? program mode ? erase mode ? program-verify mode ? erase-verify mode ? programming/erase methods the flash memory is programmed 32 bytes at a time. block erase (in single-block units) can be performed. erasing the entire memory requires erasure of each block in turn. block erasing can be performed as required on 1 kb, 28 kb, and 32 kb blocks. ? programming/erase times the flash memory programming time is 10 ms (typ.) for simultaneous 32-byte programming, equivalent to 300 s (typ.) per byte, and the erase time is 100 ms (typ.). ? reprogramming capability the flash memory can be reprogrammed up to 100 times. ? on-board programming modes there are two modes in which flash memory can be programmed/erased/verified on-board: ? boot mode ? user program mode ? automatic bit rate adjustment with data transfer in boot mode, the sh7050?s bit rate can be automatically adjusted to match the transfer bit rate of the host. ? flash memory emulation in ram flash memory programming can be emulated in real time by overlapping a part of ram onto flash memory. ? protect modes there are two protect modes, hardware and software, which allow protected status to be designated for flash memory program/erase/verify operations
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 536 of 818 rej09b0273-0500 ? programmer mode flash memory can be programmed/erased in programmer mode, using a prom programmer, as well as in on-board programming mode. 18.2 overview 18.2.1 block diagram module bus bus interface/controller flash memory (128 kb) operating mode flmcr2 internal address bus internal data bus (32 bits) fwe pin mode pin ebr1 ramer flmcr1 legend: flmcr1: flash memory control register 1 flmcr2: flash memory control register 2 ebr1: erase block register 1 ramer: ram emulation register figure 18.1 block diagram of flash memory
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 537 of 818 rej09b0273-0500 18.2.2 mode transitions when the mode pins and the fwe pin are set in the reset state and a reset-start is executed, the sh7050 enters one of the operating modes shown in figure 18.2. in user mode, flash memory can be read but not programmed or erased. flash memory can be programmed and erased in boot mode, user program mode, and programmer mode. boot mode on-board programming mode user program mode user mode reset state programmer mode res = 0 fwe = 1 fwe = 0 * 1 * 1 * 2 notes: only make a transition between user mode and user program mode when the cpu is not accessing the flash memory. 1. ram emulation possible 2. md0 = 1, md1 = 0, md2 = 1, md3 = 1 res = 0 md1 = 0, fwe = 1 res = 0 res = 0 md1 = 1, fwe = 0 md1 = 1, fwe = 1 figure 18.2 flash memory mode transitions
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 538 of 818 rej09b0273-0500 18.2.3 on-board programming modes boot mode flash memory sh7050 ram host programming control program sci application program (old version) new application program flash memory sh7050 ram host sci application program (old version) boot program area new application program flash memory sh7050 ram host sci flash memory erase boot program new application program flash memory sh7050 program execution state ram host sci new application program boot program programming control program 1. initial state the old program version or data remains written in the flash memory. the user should prepare the programming control program and new application program beforehand in the host. 2. programming control program transfer when boot mode is entered, the boot program in the sh7050 (originally incorporated in the chip) is started and the programming control program in the host is transferred to ram via sci communication. the boot program required for flash memory erasing is automatically transferred to the ram boot program area. 3. flash memory initialization the erase program in the boot program area (in ram) is executed, and the flash memory is initialized (to h'ff). in boot mode, entire flash memory erasure is performed, without regard to blocks. 4. writing new application program the programming control program transferred from the host to ram is executed, and the new application program in the host is written into the flash memory. programming control program boot program boot program boot program area boot program area programming control program
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 539 of 818 rej09b0273-0500 user program mode flash memory sh7050 ram host programming/ erase control program sci boot program new application program flash memory sh7050 ram host sci new application program flash memory sh7050 ram host sci flash memory erase boot program new application program flash memory sh7050 program execution state ram host sci boot program boot program fwe assessment program application program (old version) new application program 1. initial state the fwe assessment program that confirms that user program mode has been entered, and the program that will transfer the programming/erase control program from flash memory to on-chip ram should be written into the flash memory by the user beforehand. the programming/erase control program should be prepared in the host or in the flash memory. 2. programming/erase control program transfer when user program mode is entered, user software confirms this fact, executes transfer program in the flash memory, and transfers the programming/erase control program to ram. 3. flash memory initialization the programming/erase program in ram is executed, and the flash memory is initialized (to h'ff). erasing can be performed in block units, but not in byte units. 4. writing new application program next, the new application program in the host is written into the erased flash memory blocks. do not write to unerased blocks. programming/ erase control program programming/ erase control program programming/ erase control program transfer program application program (old version) transfer program fwe assessment program fwe assessment program transfer program fwe assessment program
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 540 of 818 rej09b0273-0500 18.2.4 flash memory emulation in ram emulation should be performed in user mode or user program mode. when the emulation block set in ramer is accessed while the emulation function is being executed, data written in the overlap ram is read. user mode ? user program mode application program execution state flash memory emulation block ram sci overlap ram (emulation is performed on data written in ram) when overlap ram data is confirmed, the rams bit is cleared, ram overlap is released, and writes should actually be performed to the flash memory. when the programming control program is transferred to ram, ensure that the transfer destination and the overlap ram do not overlap, as this will cause data in the overlap ram to be rewritten.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 541 of 818 rej09b0273-0500 ? user program mode application program flash memory ram sci programming control program execution state overlap ram (programming data) programming data 18.2.5 differences between boot mode and user program mode boot mode user program mode entire memory erase yes yes block erase no yes programming control program * (2) (1) (2) (3) (1) erase/erase-verify (2) program/program-verify (3) emulation note: * to be provided by the user, in accordance with the recommended algorithm.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 542 of 818 rej09b0273-0500 18.2.6 block configuration the flash memory is divided into three 32 kb blocks, one 28 kb blocks, and four 1 kb blocks. address h'00000 address h'1ffff 32 kb 32 kb 32 kb 1 kb 1 kb 1 kb 1 kb 28 kb 128 kb 18.3 pin configuration the flash memory is controlled by means of the pins shown in table 18.1. table 18.1 flash memory pins pin name abbreviation i/o function reset res input reset flash memory enable fwe input flash program/erase protection by hardware mode 3 md3 input sets sh7050 operating mode mode 2 md2 input sets sh7050 operating mode mode 1 md1 input sets sh7050 operating mode mode 0 md0 input sets sh7050 operating mode transmit data txd1 output serial transmit data output receive data rxd1 input serial receive data input
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 543 of 818 rej09b0273-0500 18.4 register configuration the registers used to control the on-chip flash memory when enabled are shown in table 18.2. table 18.2 flash memory registers register name abbreviation r/w initial value address access size flash memory control register 1 flmcr1 r/w * 1 h'00 * 3 h'ffff8580 8 flash memory control register 2 flmcr2 r * 2 h'00 h'ffff8581 8 erase block register 1 ebr1 r/w * 1 h'00 * 4 h'ffff8582 8 ram emulation register ramer r/w h'0000 h'ffff8628 8, 16, 32 notes: flmcr1, flmcr2, and ebr1 are 8-bit registers, and ramer is a 16-bit register. only byte accesses are valid for flmcr1, flmcr2, and ebr1, the access requiring 3 cycles. three cycles are required for a byte or word access to ramer, and 6 cycles for a longword access. when a longword write is performed on ramer, 0 must always be written to the lower word (address h'ffff8630). operation is not guaranteed if any other value is written. 1. in modes in which the on-chip flash memory is disabled, a read will return h'00, and writes are invalid. writes are also disabled when the fwe bit is set to 1 in flmcr1. 2. a read in a mode in which on-chip flash memory is disabled will return h'00. 3. when a high level is input to the fwe pin, the initial value is h'80. 4. when a low level is input to the fwe pin, or if a high level is input and the swe bit in flmcr1 is not set, these registers are initialized to h'00.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 544 of 818 rej09b0273-0500 18.5 register descriptions 18.5.1 flash memory control register 1 (flmcr1) flmcr1 is an 8-bit register used for flash memory operating mode control. program-verify mode or erase-verify mode is entered by setting swe to 1 when fwe = 1. program mode is entered by setting swe to 1 when fwe = 1, then setting the psu bit, and finally setting the p bit. erase mode is entered by setting swe to 1 when fwe = 1, then setting the esu bit, and finally setting the e bit. flmcr1 is initialized by a reset, and in hardware standby mode and software standby mode. its initial value is h'80 when a high level is input to the fwe pin, and h'00 when a low level is input. when on-chip flash memory is disabled, a read will return h'00, and writes are invalid. writes to bits swe, esu, psu, ev, and pv in flmcr1 are enabled only when fwe = 1 and swe = 1; writes to the e bit only when fwe = 1, swe = 1, and esu = 1; and writes to the p bit only when fwe = 1, swe = 1, and psu = 1. bit:76543210 fwe swe esu psu ev pv e p initial value:1/00000000 r/w: r r/w r/w r/w r/w r/w r/w r/w bit 7?flash write enable bit (fwe): sets hardware protection against flash memory programming/erasing. bit 7: fwe description 0 when a low level is input to the fwe pin (hardware-protected state) (initial value) 1 when a high level is input to the fwe pin bit 6?software write enable bit (swe): enables or disables the flash memory. this bit should be set before setting bits 5 to 0, and ebr1 bits 7 to 0.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 545 of 818 rej09b0273-0500 bit 6: swe description 0 writes disabled (initial value) 1 writes enabled [setting condition] when fwe = 1 bit 5?erase setup bit (esu): prepares for a transition to erase mode. do not set the swe, psu, ev, pv, e, or p bit at the same time. bit 5: esu description 0 erase setup cleared (initial value) 1 erase setup [setting condition] when fwe = 1 and swe = 1 bit 4?program setup bit (psu): prepares for a transition to program mode. do not set the swe, esu, ev, pv, e, or p bit at the same time. bit 4: psu description 0 program setup cleared (initial value) 1 program setup [setting condition] when fwe = 1 and swe = 1 bit 3?erase-verify (ev): selects erase-verify mode transition or clearing. do not set the swe, esu, psu, pv, e, or p bit at the same time. bit 3: ev description 0 erase-verify mode cleared (initial value) 1 transition to erase-verify mode [setting condition] when fwe = 1 and swe = 1
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 546 of 818 rej09b0273-0500 bit 2?program-verify (pv): selects program-verify mode transition or clearing. do not set the swe, esu, psu, ev, e, or p bit at the same time. bit 2: pv description 0 program-verify mode cleared (initial value) 1 transition to program-verify mode [setting condition] when fwe = 1 and swe = 1 bit 1?erase (e): selects erase mode transition or clearing. do not set the swe, esu, psu, ev, pv, or p bit at the same time. bit 1: e description 0 erase mode cleared (initial value) 1 transition to erase mode [setting condition] when fwe = 1, swe = 1, and esu1 = 1 bit 0?program 1 (p1): selects program mode transition or clearing. do not set the swe, psu, esu, ev, pv, or e bit at the same time. bit 0: p description 0 program mode cleared (initial value) 1 transition to program mode [setting condition] when fwe = 1, swe = 1, and psu1 = 1
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 547 of 818 rej09b0273-0500 18.5.2 flash memory control register 2 (flmcr2) flmcr2 is an 8-bit register that monitors the presence or absence of flash memory program/erase protection (error protection). flmcr2 is initialized to h'00 by a reset, and in hardware standby mode. when on-chip flash memory is disabled, a read will return h'00. bit:76543210 fler??????? initial value:00000000 r/w:rrrrrrrr bit 7?flash memory error (fler): indicates that an error has occurred during an operation on flash memory (programming or erasing). when fler is set to 1, flash memory goes to the error- protection state. bit 7: fler description 0 flash memory is operating normally. flash memory program/erase protection (error protection) is disabled. [clearing condition] reset or hardware standby mode (initial value) 1 an error has occurred during flash memory programming/erasing. flash memory program/erase protection (error protection) is enabled. [setting condition] see section 18.8.3, error protection. bits 6 to 0?reserved: these bits are always read as 0.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 548 of 818 rej09b0273-0500 18.5.3 erase block register 1 (ebr1) ebr1 is an 8-bit readable/writable register that specifies the flash memory erase area block by block. ebr1 is initialized to h'00 by a reset, in hardware standby mode and software standby mode, when a low level is input to the fwe pin, and when a high level is input to the fwe pin and the swe bit in flmcr1 is not set. when a bit in ebr1 is set to 1, the corresponding block can be erased. other blocks are erase-protected. set only one bit in ebr1 (more than one bit cannot be set). when on-chip flash memory is disabled, a read will return h'00, and writes are invalid. the flash memory block configuration is shown in table 18.3. bit:76543210 eb7 eb6 eb5 eb4 eb3 eb2 eb1 eb0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table 18.3 flash memory erase blocks block (size) address eb0 (32 kb) h'000000?h'007fff eb1 (32 kb) h'008000?h'00ffff eb2 (32 kb) h'010000?h'017fff eb3 (28 kb) h'018000?h'01efff eb4 (1 kb) h'01f000?h'01f3ff eb5 (1 kb) h'01f400?h'01f7ff eb6 (1 kb) h'01f800?h'01fbff eb7 (1 kb) h'01fc00?h'01ffff
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 549 of 818 rej09b0273-0500 18.5.4 ram emulation register (ramer) ramer specifies the area of flash memory to be overlapped with part of ram when emulating real-time flash memory programming. ramer is initialized to h'0000 by a reset and in hardware standby mode. it is not initialized in software standby mode. ramer settings should be made in user mode or user program mode. (for details, see the description of the bsc.) flash memory area divisions are shown in table 18.4. to ensure correct operation of the emulation function, the rom for which ram emulation is performed should not be accessed immediately after this register has been modified. normal execution of an access immediately after register modification is not guaranteed. bit: 15 14 13 12 11 10 9 8 ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 ?????ramsram1ram0 initial value:00000000 r/w:rrrrrr/wr/wr/w bits 15 to 3?reserved: these bits are always read as 0. bit 2?ram select (rams): specifies selection or non-selection of flash memory emulation in ram. when rams = 1, all flash memory block are program/erase-protected. bit 2: rams description 0 emulation not selected program/erase-protection of all flash memory blocks is disabled (initial value) 1 emulation selected program/erase-protection of all flash memory blocks is enabled bits 1 and 0?flash memory area selection (ram1, ram0): these bits are used together with bit 2 to select the flash memory area to be overlapped with ram. (see table 18.4.)
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 550 of 818 rej09b0273-0500 table 18.4 flash memory area divisions addresses block name rams ram1 ram0 h'ffe800?h'ffebff ram area 1 kb 0 ** h'01f000?h'01f3ff eb4 (1 kb) 1 0 0 h'01f400?h'01f7ff eb5 (1 kb) 1 0 1 h'01f800?h'01fbff eb6 (1 kb) 1 1 0 h'01fc00?h'01ffff eb7 (1 kb) 1 1 1 18.6 on-board programming modes when pins are set to on-board programming mode and a reset-start is executed, a transition is made to the on-board programming state in which program/erase/verify operations can be performed on the on-chip flash memory. there are two on-board programming modes: boot mode and user program mode. the pin settings for transition to each of these modes are shown in table 18.5. for a diagram of the transitions to the various flash memory modes, see figure 18.2. table 18.5 setting on-board programming modes mode pll multiple fwe md3 md2 md1 md0 boot mode expanded mode 1 10000 single chip mode 0001 expanded mode 2 0100 single chip mode 0101 expanded mode 4 1000 single chip mode 1001 user program expanded mode 1 10010 mode single chip mode 0011 expanded mode 2 0110 single chip mode 0111 expanded mode 4 1010 single chip mode 1011
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 551 of 818 rej09b0273-0500 18.6.1 boot mode when boot mode is used, the flash memory programming control program must be prepared in the host beforehand. the sci to be used is set to channel asynchronous mode. when a reset-start is executed after the sh7050 pins have been set to boot mode, the boot program built into the sh7050 is started and the programming control program prepared in the host is serially transmitted to the sh7050 via the channel 1 sci. in the sh7050, the programming control program received via the channel 1 sci is written into the programming control program area in on-chip ram. after the transfer is completed, control branches to the start address of the programming control program area and the programming control program execution state is entered (flash memory programming is performed). the transferred programming control program must therefore include coding that follows the programming algorithm given later. the system configuration in boot mode is shown in figure 18.3, and the boot mode execution procedure in figure 18.4. rxd1 txd1 sci1 sh7050 flash memory write data reception verify data transmission host on-chip ram figure 18.3 system configuration in boot mode
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 552 of 818 rej09b0273-0500 note: if a memory cell does not operate normally and cannot be erased, one h'ff byte is transmitted as an erase error, and the erase operation and subsequent operations are halted. start set pins to boot mode and execute reset-start host transfers data (h'00) continuously at prescribed bit rate sh7050 measures low period of h'00 data transmitted by host sh7050 calculates bit rate and sets value in bit rate register after bit rate adjustment, sh7050 transmits one h'00 data byte to host to indicate end of adjustment host confirms normal reception of bit rate adjustment end indication (h'00), and transmits one h'55 data byte after receiving h'55, sh7050 transmits one h'aa data byte to host host transmits number of programming control program bytes (n), upper byte followed by lower byte sh7050 transmits received number of bytes to host as verify data (echo-back) n = 1 host transmits programming control program sequentially in byte units sh7050 transmits received programming control program to host as verify data (echo-back) transfer received programming control program to on-chip ram n = n? no yes end of transmission check flash memory data, and if data has already been written, erase all blocks after confirming that all flash memory data has been erased, sh7050 transmits one h'aa data byte to host execute programming control program transferred to on-chip ram n + 1 n figure 18.4 boot mode execution procedure
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 553 of 818 rej09b0273-0500 automatic sci bit rate adjustment start bit stop bit d0 d1 d2 d3 d4 d5 d6 d7 low period (9 bits) measured (h'00 data) high period (1 or more bits) when boot mode is initiated, the sh7050 measures the low period of the asynchronous sci communication data (h'00) transmitted continuously from the host. the sci transmit/receive format should be set as follows: 8-bit data, 1 stop bit, no parity. the sh7050 calculates the bit rate of the transmission from the host from the measured low period, and transmits one h'00 byte to the host to indicate the end of bit rate adjustment. the host should confirm that this adjustment end indication (h'00) has been received normally, and transmit one h'55 byte to the sh7050. if reception cannot be performed normally, initiate boot mode again (reset), and repeat the above operations. depending on the host ? s transmission bit rate and the sh7050 ? s system clock frequency, there will be a discrepancy between the bit rates of the host and the sh7050. to ensure correct sci operation, the host ? s transfer bit rate should be set to 4800bps, 9600bps. table 18.6 shows host transfer bit rates and system clock frequencies for which automatic adjustment of the sh7050 bit rate is possible. the boot program should be executed within this system clock range. table 18.6 system clock frequencies for which automatic adjustment of sh7050 bit rate is possible host bit rate system clock frequency for which automatic adjustment of sh7050 bit rate is possible 9600bps 8 to 20mhz 4800bps 4 to 20mhz
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 554 of 818 rej09b0273-0500 on-chip ram area divisions in boot mode: in boot mode, the ram area is divided into an area used by the boot program and an area to which the programming control program is transferred via the sci, as shown in figure 18.5. the boot program area cannot be used until the execution state in boot mode switches to the programming control program transferred from the host. h'ffffe800 h'ffffefff h'ffffffff boot program area ( 2 kbytes) programming control program area (4 kbytes) figure 18.5 ram areas in boot mode note: the boot program area cannot be used until a transition is made to the execution state for the programming control program transferred to ram. note also that the boot program remains in this area of the on-chip ram even after control branches to the programming control program.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 555 of 818 rej09b0273-0500 18.6.2 user program mode after setting fwe, the user should branch to, and execute, the previously prepared programming/erase control program. as the flash memory itself cannot be read while flash memory programming/erasing is being executed, the control program that performs programming and erasing should be run in on-chip ram or external memory. use the following procedure (figure 18.6) to execute the programming control program that writes to flash memory (when transferred to ram). execute user application program execute programming/ erase control program in ram (flash memory rewriting) transfer programming/erase control program to ram fwe = 1 (user program mode) write fwe assessment program and transfer program 1 2 3 4 5 figure 18.6 user program mode execution procedure note: when programming and erasing, start the watchdog timer so that measures can be taken to prevent program runaway, etc. memory cells may not operate normally if overprogrammed or overerased due to program runaway.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 556 of 818 rej09b0273-0500 18.7 programming/erasing flash memory a software method, using the cpu, is employed to program and erase flash memory in the on- board programming modes. there are four flash memory operating modes: program mode, erase mode, program-verify mode, and erase-verify mode. transitions to these modes can be made by setting the psu, esu, p, e, pv, and ev bits in flmcr1. the flash memory cannot be read while being programmed or erased. therefore, the program (programming control program) that controls flash memory programming/erasing should be located and executed in on-chip ram or external memory. notes: 1. operation is not guaranteed if setting/resetting of the swe, esu, psu, ev, pv, e, and p bits in flmcr1 is executed by a program in flash memory. 2. when programming or erasing, set fwe to 1 (programming/erasing will not be executed if fwe = 0). 3. programming should be performed in the erased state. do not perform additional programming on previously programmed addresses. 18.7.1 program mode follow the procedure shown in the program/program-verify flowchart in figure 18.7 to write data or programs to flash memory. performing program operations according to this flowchart will enable data or programs to be written to flash memory without subjecting the device to voltage stress or sacrificing program data reliability. programming should be carried out 32 bytes at a time. following the elapse of 10 s or more after the swe bit is set to 1 in flash memory control register 1 (flmcr1), 32-byte program data is stored in the program data area and reprogram data area, and the 32-byte data in the program data area in ram is written consecutively to the program address (the lower 8 bits of the first address written to must be h'00, h'20, h'40, h'60, h'80, h'a0, h'c0, or h'e0). thirty-two consecutive byte data transfers are performed. the program address and program data are latched in the flash memory. a 32-byte data transfer must be performed even if writing fewer than 32 bytes; in this case, h'ff data must be written to the extra addresses. next, the watchdog timer is set to prevent overprogramming in the event of program runaway, etc. set 6.6 ms as the wdt overflow period. after this, preparation for program mode (program setup) is carried out by setting the psu bit in flmcr1, and after the elapse of 50 s or more, the operating mode is switched to program mode by setting the p bit in flmcr1. the time during which the p bit is set is the flash memory programming time. use a fixed 500 s pulse for the write time.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 557 of 818 rej09b0273-0500 18.7.2 program-verify mode in program-verify mode, the data written in program mode is read to check whether it has been correctly written in the flash memory. after the elapse of a given programming time, the programming mode is exited (the p bit in flmcr1 is cleared, then the psun bit is cleared at least 10 s later). the watchdog timer is cleared after the elapse of 10 s or more, and the operating mode is switched to program-verify mode by setting the pv bit in flmcr1. before reading in program-verify mode, a dummy write of h'ff data should be made to the addresses to be read. the dummy write should be executed after the elapse of 4 s or more. when the flash memory is read in this state (verify data is read in 32-bit units), the data at the latched address is read. wait at least 2 s after the dummy write before performing this read operation. next, the written data is compared with the verify data, and reprogram data is computed (see figure 18.7) and transferred to the reprogram data area. after 32 bytes of data have been verified, exit program-verify mode, wait for at least 4 s, then clear the swe bit in flmcr1. if reprogramming is necessary, set program mode again, and repeat the program/program-verify sequence as before. however, ensure that the program/program-verify sequence is not repeated more than 400 times on the same bits.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 558 of 818 rej09b0273-0500 set swe-bit of flmcr1 wait 10 s n = 1 m = 0 successively write 32-byte data in rewrite data area in ram to flash memory enable wdt set psu-bit of flmcr1 wait 50 s set p-bit of flmcr1 wait 500 s write start clear p-bit of flmcr1 wait 10 s wait 10 s ng ng ng ng ok ok ok wait 4 s wait 2 s * 4 * 2 store 32 bytes write data in write data area and rewrite data area * 4 * 1 wait 4 s clear psu-bit of flmcr1 disable wdt set pv-bit of flmcr1 perform dummy-write of h'ff to verify address clear pv-bit of flmcr1 clear swe bit of flmcr1 m = 1 write end write data= verify data? 32 byte data verify complete? m = 0? increment address ok clear swe bit of flmcr1 n 400? n n + 1 notes: start ram write data storage area (32 byte) transfer rewrite data to rewrite data area write end write failure read verify data * 3 operate rewrite data source data (d) 0 0 1 1 verify data (v) 0 1 0 1 rewrite data (x) 1 0 1 1 description rewrite should not be performed to bits already written to. write is incomplete; rewrite should be performed. ? left in the erased state. rewrite data storage area (32 byte) data writes must be performed in the memory- erased state. do not write additional data to an address to which data is already written. 1. transfer data in a byte unit. the lower eight bits of the start address to which data is written must be h'00, h'20, h'40, h'60, h'80, h'a0, h'c0, or h'e0. transfer 32-byte data even when writing fewer than 32 bytes. in this case, set h'ff in unused addresses. 2. read verify data in logword form (32 bits). 3. even for bits to which data is already written, an additional write should be performed if their verify result is ng. 4. the write data storage area (32 bytes) and rewrite data storage area (32 bytes) must be located in ram. the contents of the rewrite data storage area are rewritten as writing progresses. figure 18.7 program/program-verify flowchart
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 559 of 818 rej09b0273-0500 18.7.3 erase mode to perform data or program erasure, set the 1 bit flash memory area to be erased in erase block register 1 (ebr1) at least 10 s after setting the swe bit to 1 in flash memory control register 1 (flmcr1). next, the watchdog timer is set to prevent overerasing in the event of program runaway, etc. set 6.6 ms as the wdt overflow period. after this, preparation for erase mode (erase setup) is carried out by setting the esu bit in flmcr1, and after the elapse of 200 s or more, the operating mode is switched to erase mode by setting the e bit in flmcr1. the time during which the e bit is set is the flash memory erase time. ensure that the erase time does not exceed 5 ms. note: with flash memory erasing, preprogramming (setting all memory data in the memory to be erased to all ? 0 ? ) is not necessary before starting the erase procedure. 18.7.4 erase-verify mode in erase-verify mode, data is read after memory has been erased to check whether it has been correctly erased. after the elapse of the erase time, erase mode is exited (the e bit in flmcr1 is cleared, then the esu bit is cleared at least 10 s later), the watchdog timer is cleared after the elapse of 10 s or more, and the operating mode is switched to erase-verify mode by setting the ev bit in flmcr1. before reading in erase-verify mode, a dummy write of h'ff data should be made to the addresses to be read. the dummy write should be executed after the elapse of 20 s or more. when the flash memory is read in this state (verify data is read in 32-bit units), the data at the latched address is read. wait at least 2 s after the dummy write before performing this read operation. if the read data has been erased (all ? 1 ? ), a dummy write is performed to the next address, and erase-verify is performed. if the read data has not been erased, set erase mode again, and repeat the erase/erase- verify sequence in the same way. however, ensure that the erase/erase-verify sequence is not repeated more than 60 times. when verification is completed, exit erase-verify mode, and wait for at least 5 s. if erasure has been completed on all the erase blocks, clear the swe bit in flmcr1. if there are any unerased blocks, set 1 bit for the flash memory area to be erased, and repeat the erase/erase-verify sequence in the same way.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 560 of 818 rej09b0273-0500 erase complete start set swe bit in flmcr1 set esu-bit of flmcr1 set e-bit of flmcr1 wait 10 s wait 200 s n = 1 set ebr1 wdt enable * 3 wait 5ms wait 10 s wait 10 s wait 20 s set top block address to verify address wait 2 s wait 5 s * 2 * 4 erase start clear e-bit of flmcr1 clear esu-bit of flmcr1 set ev-bit of flmcr1 dummy write h'ff to verify address read verify data clear ev-bit of flmcr1 wait 5 s clear ev-bit of flmcr1 clear swe-bit in flmcr1 wdt disable erase stop * 1 verify data = all "1"? last block address? all objective blocks erased? erase error clear swe-bit of flmcr1 n 61? ng ng ng ng ok ok ok ok n n + 1 address increment notes: 1. preprogramming (setting erase block data to all ? 0 ? ) is not necessary. 2. verify data is read in 32-bit (longword) units. 3. set only one bit in ebr1. more than one bit cannot be set. 4. erasing is performed in block units. to erase a number of blocks, each block must be erased in turn. figure 18.8 erase/erase-verify flowchart
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 561 of 818 rej09b0273-0500 18.8 protection there are two kinds of flash memory program/erase protection, hardware protection and software protection. 18.8.1 hardware protection hardware protection refers to a state in which programming/erasing of flash memory is forcibly disabled or aborted. hardware protection is reset by settings in flash memory control register 1 (flmcr1) and erase block register 1 (ebr1). the flmcr1 and ebr1 settings are retained in the error-protected state. (see table 18.7.) table 18.7 hardware protection functions item description program erase fwe pin protection ? when a low level is input to the fwe pin, flmcr1 and ebr1 are initialized, and the program/erase-protected state is entered. yes yes reset/standby protection ? in a reset (including a wdt overflow reset) and in standby mode, flmcr1 and ebr1 are initialized, and the program/erase-protected state is entered. ? in a reset via the res pin, the reset state is not entered unless the res pin is held low until oscillation stabilizes after powering on. in the case of a reset during operation, hold the res pin low for the res pulse width specified in the ac characteristics section. yes yes
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 562 of 818 rej09b0273-0500 18.8.2 software protection software protection can be implemented by setting erase block register 1 (ebr1) and the rams bit in the ram emulation register (ramer). when software protection is in effect, setting the p or e bit in flash memory control register 1 (flmcr1) does not cause a transition to program mode or erase mode. (see table 18.8.) table 18.8 software protection functions item description program erase swe pin protection ? clearing the swe bit to 0 in flmcr1 sets the program/erase-protected state for all blocks. ? (execute in on-chip ram or external memory.) yes yes block specification protection ? erase protection can be set for individual blocks by settings in erase block register 1 (ebr1). ? setting ebr1 to h'00 places all blocks in the erase-protected state. ? yes emulation protection ? setting the rams bit to 1 in the ram emulation register (ramer) places all blocks in the program/erase-protected state. yes yes
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 563 of 818 rej09b0273-0500 18.8.3 error protection in error protection, an error is detected when sh7050 runaway occurs during flash memory programming/erasing, or operation is not performed in accordance with the program/erase algorithm, and the program/erase operation is aborted. aborting the program/erase operation prevents damage to the flash memory due to overprogramming or overerasing. if the sh7050 malfunctions during flash memory programming/erasing, the fler bit is set to 1 in flmcr2 and the error protection state is entered. the flmcr1 and ebr1 settings are retained, but program mode or erase mode is aborted at the point at which the error occurred. program mode or erase mode cannot be re-entered by re-setting the p or e bit. however, pv and ev bit setting is enabled, and a transition can be made to verify mode. fler bit setting conditions are as follows: 1. when flash memory is read during programming/erasing (including a vector read or instruction fetch) 2. immediately after exception handling (excluding a reset) during programming/erasing 3. when a sleep instruction (including software standby) is executed during programming/erasing 4. when the bus is released during programming/erasing error protection is released only by a reset and in hardware standby mode. figure 18.9 shows the flash memory state transition diagram.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 564 of 818 rej09b0273-0500 rd vf pr er fler = 0 error occurrence res = 0 or hstby = 0 res = 0 or hstby = 0 rd vf pr er fler = 0 program mode erase mode reset or standby (hardware protection) rd vf pr er fler = 1 rd vf pr er fler = 1 error protection mode error protection mode (software standby) software standby mode flmcr1, ebr1 initialization state flmcr1, ebr1 initialization state software standby mode release rd: memory read possible vf: verify-read possible pr: programming possible er: erasing possible rd : memory read not possible vf : verify-read not possible pr : programming not possible er : erasing not possible legend: res = 0 or hstby = 0 error occurrence (software standby) figure 18.9 flash memory state transitions
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 565 of 818 rej09b0273-0500 18.9 flash memory emulation in ram making a setting in the ram emulation register (ramer) enables part of ram to be overlapped onto the flash memory area so that data to be written to flash memory can be emulated in ram in real time. after the ramer setting has been made, accesses cannot be made from the flash memory area or the ram area overlapping flash memory. emulation can be performed in user mode and user program mode. figure 18.10 shows an example of emulation of real-time flash memory programming. start emulation program end of emulation program tuning ok? yes no set ramer write tuning data to overlap ram execute application program clear ramer write to flash memory emulation block figure 18.10 flowchart for flash memory emulation in ram
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 566 of 818 rej09b0273-0500 h'000000 h'01f000 h'01f400 h'01f800 h'01fc00 h'01ffff flash memory eb0 to eb3 this area can be accessed from both the ram area and flash memory area eb7 eb6 eb5 eb4 h'ffffe800 h'ffffebff on-chip ram figure 18.11 example of ram overlap operation example in which flash memory block area (eb4) is overlapped 1. set bits rams, ram1, and ram0 in ramer to 1, 0, 1, to overlap part of ram onto the area (eb4) for which real-time programming is required. 2. real-time programming is performed using the overlapping ram. 3. after the program data has been confirmed, the rams bit is cleared, releasing ram overlap. 4. the data written in the overlapping ram is written into the flash memory space (eb4). notes: 1. when the rams bit is set to 1, program/erase protection is enabled for all blocks regardless of the value of ram1 and ram0 (emulation protection). in this state, setting the p or e bit in flash memory control register 1 (flmcr1) will not cause a transition to program mode or erase mode. when actually programming a flash memory area, the rams bit should be cleared to 0. 2. a ram area cannot be erased by execution of software in accordance with the erase algorithm while flash memory emulation in ram is being used.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 567 of 818 rej09b0273-0500 18.10 note on flash memory programming/erasing in the on-board programming modes (user mode and user program mode), nmi input should be disabled to give top priority to the program/erase operations (including ram emulation). 18.11 flash memory programmer mode programs and data can be written and erased in programmer mode as well as in the on-board programming modes. in programmer mode, flash memory read mode, auto-program mode, auto- erase mode, and status read mode are supported. in auto-program mode, auto-erase mode, and status read mode, a status polling procedure is used, and in status read mode, detailed internal signals are output after execution of an auto-program or auto-erase operation. in programmer mode, set the mode pins to pllx2 mode (see table 18.9) and input a 6 mhz input clock, so that the sh7050 runs at 12 mhz. table 18.9 shows the pin settings for programmer mode. for the pin names in programmer mode, see section 1.3.3, pin assignments. table 18.9 prom mode pin settings pin names settings mode pins: md3, md2, md1, md0 1101 (pll 2) fwe pin high level input (in auto-program and auto-erase modes) res pin power-on reset circuit xtal, extal, pllv cc , pllcap, pllv ss pins oscillator circuit
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 568 of 818 rej09b0273-0500 18.11.1 socket adapter pin correspondence diagram connect the socket adapter to the chip as shown in figure 18.13. this will enable conversion to a 32-pin arrangement. the on-chip rom memory map is shown in figure 18.12, and the socket adapter pin correspondence diagram in figure 18.13. h'00000000 addresses in mcu mode addresses in programmer mode h'0001ffff h'00000 h'1ffff on-chip rom space 128 kb figure 18.12 on-chip rom memory map
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 569 of 818 rej09b0273-0500 pin no. 118 112 38 36 42 85 86 87 88 90 92 93 94 17 18 19 20 22 24 25 26 27 28 30 32 33 34 35 41 1, 2, 5, 13, 21, 29, 37, 47, 55, 72, 79, 89, 97, 105, 109, 111, 113, 120, 124, 130, 142, 149, 150, 158 7, 15, 23, 31, 39, 49, 57, 64, 70, 81, 91, 99, 107, 115, 119, 136, 144, 152, 164 40 126 108 110 121 122 123 other than the above pin no. 1 26 2 3 31 13 14 15 17 18 19 20 21 12 11 10 9 8 7 6 5 27 24 23 25 4 28 29 22 32 16 30 hn28f101p (32 pins) pin name fwe a9 a16 a15 we i/o0 i/o1 i/o2 i/o3 i/o4 i/o5 i/o6 i/o7 a0 a1 a2 a3 a4 a5 a6 a7 a8 oe a10 a11 a12 a13 a14 ce v cc v ss a17 pin name fwe a9 a16 a15 we d0 d1 d2 d3 d4 d5 d6 d7 a0 a1 a2 a3 a4 a5 a6 a7 a8 oe a10 a11 a12 a13 a14 ce v ss a17 res xtal extal pllv cc pllcap pllv ss n.c.(open) sh7050 (128 kb version) socket adapter (conversion to 32-pin arrangement) power-on reset circuit oscillator circuit pll circuit legend: fwe: flash write enable i/o7 ? i/o0: data input/output a17 ? a0: address input oe : output enable ce : chip enable we : write enable note: use address pin a17 as v ss . v cc figure 18.13 socket adapter pin correspondence diagram
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 570 of 818 rej09b0273-0500 18.11.2 programmer mode operation table 18.10 shows how the different operating modes are set when using programmer mode, and table 18.11 lists the commands used in programmer mode. details of each mode are given below. ? memory read mode memory read mode supports byte reads. ? auto-program mode auto-program mode supports programming of 128 bytes at a time. status polling is used to confirm the end of auto-programming. ? auto-erase mode auto-erase mode supports automatic erasing of the entire flash memory. status polling is used to confirm the end of auto-programming. ? status read mode status polling is used for auto-programming and auto-erasing, and normal termination can be confirmed by reading the d6 signal. in status read mode, error information is output if an error occurs. table 18.10 settings for various operating modes in programmer mode pin names mode fwe ce ce ce ce oe oe oe oe we we we we d0?d7 a0?a17 read h or l l l h data output ain output disable h or l l h h hi-z x command write h or l l h l data input * ain chip disable h or l h x x hi-z x notes: 1. chip disable is not a standby state; internally, it is an operation state. 2. * ain indicates that there is also address input in auto-program mode. 3. for command writes in auto-program and auto-erase modes, input a high level to the fwe pin.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 571 of 818 rej09b0273-0500 table 18.11 programmer mode commands 1st cycle 2nd cycle command name number of cycles mode address data mode address data memory read mode 1 + n write x h'00 read ra dout auto-program mode 129 write x h'40 write wa din auto-erase mode 2 write x h'20 write x h'20 status read mode 2 write x h'71 write x h'71 notes: 1. in auto-program mode. 129 cycles are required for command writing by a simultaneous 128-byte write. 2. in memory read mode, the number of cycles depends on the number of address write cycles (n). 18.11.3 memory read mode 1. after completion of auto-program/auto-erase/status read operations, a transition is made to the command wait state. when reading memory contents, a transition to memory read mode must first be made with a command write, after which the memory contents are read. 2. in memory read mode, command writes can be performed in the same way as in the command wait state. 3. once memory read mode has been entered, consecutive reads can be performed. 4. after powering on, memory read mode is entered.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 572 of 818 rej09b0273-0500 table 18.12 ac characteristics in transition to memory read mode conditions: v cc = 5.0 v 10%, v ss = 0 v, t a = 25 c 5 c item symbol min max unit notes command write cycle t nxtc 20 s ce hold time t ceh 0ns ce setup time t ces 0ns data hold time t dh 50 ns data setup time t ds 50 ns write pulse width t wep 70 ns we rise time t r 30 ns we fall time t f 30 ns ce oe ce a16 ? a0 oe we i/o7 ? i/o0 note: data is latched on the rising edge of we . t ceh t wep t f t r t ces t nxtc address stable t ds t dh command write memory read mode figure 18.14 timing waveforms for memory read after memory write
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 573 of 818 rej09b0273-0500 table 18.13 ac characteristics in transition from memory read mode to another mode conditions: v cc = 5.0 v 10%, v ss = 0 v, t a = 25 c 5 c item symbol min max unit notes command write cycle t nxtc 20 s ce hold time t ceh 0ns ce setup time t ces 0ns data hold time t dh 50 ns data setup time t ds 50 ns write pulse width t wep 70 ns we rise time t r 30 ns we fall time t f 30 ns ce oe ce a16 ? a0 oe we i/o7 ? i/o0 note: do not enable we and oe at the same time. t ceh t wep t f t r t ces t nxtc address stable t ds t dh other mode command write memory read mode figure 18.15 timing waveforms in transition from memory read mode to another mode
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 574 of 818 rej09b0273-0500 table 18.14 ac characteristics in memory read mode conditions: v cc = 5.0 v 10%, v ss = 0 v, t a = 25 c 5 c item symbol min max unit notes access time t acc 20 s ce output delay time t ce 150 ns oe output delay time t oe 150 ns output disable delay time t df 100 ns data output hold time t oh 5ns ce a16 ? a0 oe we i/o7 ? i/o0 v il v il v ih t acc t acc t oh t oh address stable address stable figure 18.16 ce ce ce ce and oe oe oe oe enable state read timing waveforms
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 575 of 818 rej09b0273-0500 ce a16 ? a0 oe we i/o7 ? i/o0 v ih t acc t ce t oe t oe t ce t acc t oh t df t df t oh address stable address stable figure 18.17 ce ce ce ce and oe oe oe oe clock system read timing waveforms 18.11.4 auto-program mode 1. in auto-program mode, 128 bytes are programmed simultaneously. this should be carried out by executing 128 consecutive byte transfers. 2. a 128-byte data transfer is necessary even when programming fewer than 128 bytes. in this case, h'ff data must be written to the extra addresses. 3. the lower 7 bits of the transfer address must be low. if a value other than an effective address is input, processing will switch to a memory write operation but a write error will be flagged. 4. memory address transfer is performed in the third cycle (figure 18.13). do not perform transfer after the second cycle. 5. do not perform a command write during a programming operation. 6. perform one auto-program operation for a 128-byte block for each address. two or more additional programming operations cannot be performed on a previously programmed address block. 7. confirm normal end of auto-programming by checking d6. alternatively, status read mode can also be used for this purpose (d7 status polling uses the auto-program operation end identification pin). 8. status polling d6 and d7 pin information is retained until the next command write. as long as the next command write has not been performed, reading is possible by enabling ce and oe .
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 576 of 818 rej09b0273-0500 table 18.15 ac characteristics in auto-program mode conditions: v cc = 5.0 v 10%, v ss = 0 v, t a = 25 c 5 c item symbol min max unit notes command write cycle t nxtc 20 s ce hold time t ceh 0ns ce setup time t ces 0ns data hold time t dh 50 ns data setup time t ds 50 ns write pulse width t wep 70 ns status polling start time t wsts 1ms status polling access time t spa 150 ns address setup time t as 0ns address hold time t ah 60 ns memory write time t write 1 3000 ms write setup time t pns 100 ns write end setup time t pnh 100 ns we rise time t r 30 ns we fall time t f 30 ns
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 577 of 818 rej09b0273-0500 ce a16 ? a0 fwe oe we i/o7 i/o6 i/o5 ? i/o0 t pns t wep t ds t dh t f t r t as t ah t wsts t write t spa t ces t ceh t nxtc t nxtc t pnh address stable h'40 h'00 data transfer 1 to 128byte write operation complete verify signal write normal complete verify signal figure 18.18 auto-program mode timing waveforms
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 578 of 818 rej09b0273-0500 18.11.5 auto-erase mode 1. auto-erase mode supports only entire memory erasing. 2. do not perform a command write during auto-erasing.. 3. confirm normal end of auto-erasing by checking d6. alternatively, status read mode can also be used for this purpose (d7 status polling uses the auto-erase operation end identification pin). 4. status polling d6 and d7 pin information is retained until the next command write. as long as the next command write has not been performed, reading is possible by enabling ce and oe . table 18.16 ac characteristics in auto-erase mode conditions: v cc = 5.0 v 10%, v ss = 0 v, t a = 25 c 5 c item symbol min max unit notes command write cycle t nxtc 20 s ce hold time t ceh 0ns ce setup time t ces 0ns data hold time t dh 50 ns data setup time t ds 50 ns write pulse width t wep 70 ns status polling start time t ests 1ms status polling access time t spa 150 ns memory erase time t erase 100 40000 ms erase setup time t ens 100 ns erase end setup time t enh 100 ns we rise time t r 30 ns we fall time t f 30 ns
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 579 of 818 rej09b0273-0500 ce a16 ? a0 fwe oe we i/o7 i/o6 i/o5 ? i/o0 t ens t wep t ds t dh t f t r t ests t erase t spa t ces t ceh t nxtc t nxtc t enh h'20 h'20 h'00 erase complete verify signal erase normal complete verify signal figure 18.19 auto-erase mode timing waveforms 18.11.6 status read mode 1. status read mode is provided to specify the kind of abnormal end. use this mode when an abnormal end occurs in auto-program mode or auto-erase mode. 2. the return code is retained until a command write other than a status read mode command write is executed.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 580 of 818 rej09b0273-0500 table 18.17 ac characteristics in status read mode conditions: v cc = 5.0 v 10%, v ss = 0 v, t a = 25 c 5 c item symbol min max unit notes read time after command write t strd 20 s ce hold time t ceh 0ns ce setup time t ces 0ns data hold time t dh 50 ns data setup time t ds 50 ns write pulse width t wep 70 ns oe output delay time t oe 150 ns disable delay time t df 100 ns ce output delay time t ce 150 ns we rise time t r 30 ns we fall time t f 30 ns ce a16 ? a0 oe we i/o7 ? i/o0 t wep t f t r t oe t df t ds t ds t dh t dh t ces t ceh t ce t ceh t nxtc t nxtc t nxtc t ces h'71 t wep t f t r h'71 note: i/o2 and i/o3 are undefined. figure 18.20 status read mode timing waveforms
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 581 of 818 rej09b0273-0500 table 18.18 status read mode return commands pin name d7 d6 d5 d4 d3 d2 d1 d0 attribute normal end identification command error program- ming error erase error ?? program- ming or erase count exceeded effective address error initial value 0 0 0 0 0 0 0 0 indications normal end: 0 abnormal end: 1 command error: 1 otherwise: 0 program- ming error: 1 otherwise: 0 erasing error: 1 otherwise: 0 ?? count exceeded: 1 otherwise: 0 effective address error: 1 otherwise: 0 note: d2 and d3 are undefined at present. 18.11.7 status polling 1. d7 status polling is a flag that indicates the operating status in auto-program/auto-erase mode. 2. d6 status polling is a flag that indicates a normal or abnormal end in auto-program/auto-erase mode. table 18.19 status polling output truth table pin name during internal operation abnormal end normal end d70101 d60011 d0 ? d50000
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 582 of 818 rej09b0273-0500 18.11.8 programmer mode transition time commands cannot be accepted during the oscillation stabilization period or the programmer mode setup period. after the programmer mode setup time, a transition is made to memory read mode. table 18.20 stipulated transition times to command wait state item symbol min max unit notes standby release (oscillation stabilization time) t osc1 10 ms programmer mode setup time t bmv 10 ms v cc hold time t dwn 0ms t osc1 t bmv t dwn v cc res fwe memory read mode command wait state automatic write mode automatic erase mode command wait state normal/abnormal complete verify note : for the level of fwe input pin, set v il when using other than the automatic write mode and automatic erase mode. figure 18.21 oscillation stabilization time, boot program transfer time, and power-down sequence
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 583 of 818 rej09b0273-0500 18.11.9 notes on memory programming 1. when programming addresses which have previously been programmed, carry out auto- erasing before auto-programming. 2. when performing programming using prom mode on a chip that has been programmed/erased in an on-board programming mode, auto-erasing is recommended before carrying out auto-programming. notes: 1. the flash memory is initially in the erased state when the device is shipped by renesas. for other chips for which the erasure history is unknown, it is recommended that auto- erasing be executed to check and supplement the initialization (erase) level. 2. auto-programming should be performed once only on the same address block. additional programming cannot be performed on previously programmed address blocks. 18.12 notes when converting the f-ztat application software to the mask-rom versions please note the following when converting the f-ztat application software to the mask-rom versions. the values read from the internal registers for the flash rom of the mask-rom version and f- ztat version differ as follows. status register bit f-ztat version mask-rom version flmcr1 fwe 0: application software running 1: programming 0: is not read out 1: application software running note: this difference applies to all the f-ztat versions and all the mask-rom versions that have different rom size.
section 18 rom (128 kb version) rev. 5.00 jan 06, 2006 page 584 of 818 rej09b0273-0500
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 585 of 818 rej09b0273-0500 section 19 rom (256 kb version) 19.1 features the sh7051 has 256 kbytes of on-chip flash memory. the features of the flash memory are summarized below. ? four flash memory operating modes ? program mode ? erase mode ? program-verify mode ? erase-verify mode ? programming/erase methods the flash memory is programmed 32 bytes at a time. block erase (in single-block units) can be performed. block erasing can be performed as required on 1 kb, 28 kb, and 32 kb blocks. ? programming/erase times the flash memory programming time is 10 ms (typ.) for simultaneous 32-byte programming, equivalent to 300 s (typ.) per byte, and the erase time is 100 ms (typ.). ? reprogramming capability the flash memory can be reprogrammed up to 100 times. ? on-board programming modes there are two modes in which flash memory can be programmed/erased/verified on-board: ? boot mode ? user program mode ? automatic bit rate adjustment with data transfer in boot mode, the sh7050?s bit rate can be automatically adjusted to match the transfer bit rate of the host. ? flash memory emulation in ram flash memory programming can be emulated in real time by overlapping a part of ram onto flash memory. ? protect modes there are two protect modes, hardware and software, which allow protected status to be designated for flash memory program/erase/verify operations ? programmer mode flash memory can be programmed/erased in programmer mode, using a prom programmer, as well as in on-board programming mode.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 586 of 818 rej09b0273-0500 19.2 overview 19.2.1 block diagram module bus bus interface/controller flash memory (256 kb) operating mode flmcr2 internal address bus internal data bus (32 bits) fwe pin mode pin ebr1 ebr2 ramer flmcr1 legend: flmcr1: flash memory control register 1 flmcr2: flash memory control register 2 ebr1: erase block register 1 ebr2: erase block register 2 ramer: ram emulation register figure 19.1 block diagram of flash memory
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 587 of 818 rej09b0273-0500 19.2.2 mode transitions when the mode pins and the fwe pin are set in the reset state and a reset-start is executed, the sh7050 enters one of the operating modes shown in figure 19.2. in user mode, flash memory can be read but not programmed or erased. flash memory can be programmed and erased in boot mode, user program mode, and programmer mode. boot mode on-board programming mode user program mode user mode reset state programmer mode res = 0 fwe = 1 fwe = 0 * 1 * 1 * 2 notes: only make a transition between user mode and user program mode when the cpu is not accessing the flash memory. 1. ram emulation possible 2. md0 = 1, md1 = 0, md2 = 1, md3 = 1 res = 0 md1 = 0, fwe = 1 res = 0 res = 0 md1 = 1, fwe = 0 md1 = 1, fwe = 1 figure 19.2 flash memory mode transitions
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 588 of 818 rej09b0273-0500 19.2.3 on-board programming modes boot mode flash memory sh7051 ram host programming control program sci application program (old version) new application program flash memory sh7051 ram host sci application program (old version) boot program area new application program flash memory sh7051 ?qram?r host sci flash memory preprogramming erase boot program new application program flash memory sh7051 program execution state ram host sci new application program boot program programming control program 1. initial state the old program version or data remains written in the flash memory. the user should prepare the programming control program and new application program beforehand in the host. 2. programming control program transfer when boot mode is entered, the boot program in the sh7051 (originally incorporated in the chip) is started and the programming control program in the host is transferred to ram via sci communication. the boot program required for flash memory erasing is automatically transferred to the ram boot program area. 3. flash memory initialization the erase program in the boot program area (in ram) is executed, and the flash memory is initialized (to h'ff). in boot mode, total flash memory erasure is performed, without regard to blocks. 4. writing new application program the programming control program transferred from the host to ram is executed, and the new application program in the host is written into the flash memory. programming control program boot program boot program boot program area boot program area programming control program
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 589 of 818 rej09b0273-0500 user program mode flash memory sh7051 ram host programming/ erase control program sci boot program new application program flash memory sh7051 ram host sci new application program flash memory sh7051 ram host sci flash memory erase boot program new application program flash memory sh7051 program execution state ram host sci boot program boot program fwe assessment program application program (old version) new application program 1. initial state the fwe assessment program that confirms that user program mode has been entered, and the program that will transfer the programming/erase control program from flash memory to on-chip ram should be written into the flash memory by the user beforehand. the programming/erase control program should be prepared in the host or in the flash memory. 2. programming/erase control program transfer when user program mode is entered, user software confirms this fact, executes transfer program in the flash memory, and transfers the programming/erase control program to ram. 3. flash memory initialization the programming/erase program in ram is executed, and the flash memory is initialized (to h'ff). erasing can be performed in block units, but not in byte units. 4. writing new application program next, the new application program in the host is written into the erased flash memory blocks. do not write to unerased blocks. programming/ erase control program programming/ erase control program programming/ erase control program transfer program application program (old version) transfer program fwe assessment program fwe assessment program transfer program fwe assessment program
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 590 of 818 rej09b0273-0500 19.2.4 flash memory emulation in ram emulation should be performed in user mode or user program mode. when the emulation block set in ramer is accessed while the emulation function is being executed, data written in the overlap ram is read. user mode ? user program mode application program execution state flash memory emulation block ram sci overlap ram (emulation is performed on data written in ram) when overlap ram data is confirmed, the rams bit is cleared, ram overlap is released, and writes should actually be performed to the flash memory. when the programming control program is transferred to ram, ensure that the transfer destination and the overlap ram do not overlap, as this will cause data in the overlap ram to be rewritten.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 591 of 818 rej09b0273-0500 ? user program mode application program flash memory ram sci programming control program execution state overlap ram (programming data) programming data 19.2.5 differences between boot mode and user program mode boot mode user program mode total erase yes no block erase no yes programming control program * (2) (1) (2) (3) (1) erase/erase-verify (2) program/program-verify (3) emulation note: * to be provided by the user, in accordance with the recommended algorithm.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 592 of 818 rej09b0273-0500 19.2.6 block configuration the flash memory is divided into seven 32 kb blocks, one 28 kb blocks, and four 1 kb blocks. address h'00000 address h'3ffff 32 kb 32 kb 32 kb 32 kb 1 kb 1 kb 1 kb 1 kb 32 kb 32 kb 32 kb 28 kb 256 kb
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 593 of 818 rej09b0273-0500 19.3 pin configuration the flash memory is controlled by means of the pins shown in table 19.1. table 19.1 flash memory pins pin name abbreviation i/o function reset res input reset flash memory enable fwe input flash program/erase protection by hardware mode 3 md3 input sets sh7051 operating mode mode 2 md2 input sets sh7051 operating mode mode 1 md1 input sets sh7051 operating mode mode 0 md0 input sets sh7051 operating mode transmit data txd1 output serial transmit data output receive data rxd1 input serial receive data input
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 594 of 818 rej09b0273-0500 19.4 register configuration the registers used to control the on-chip flash memory when enabled are shown in table 19.2. table 19.2 flash memory registers register name abbreviation r/w initial value address access size flash memory control register 1 flmcr1 r/w * 1 h'00 * 2 h'ffff8580 8 flash memory control register 2 flmcr2 r/w * 1 h'00 * 3 h'ffff8581 8 erase block register 1 ebr1 r/w * 1 h'00 * 3 h'ffff8582 8 erase block register 2 ebr2 r/w * 1 h'00 * 3 h'ffff8583 8 ram emulation register ramer r/w h'0000 h'ffff8628 8, 16, 32 notes: flmcr1, flmcr2, ebr1, and ebr2 are 8-bit registers, and ramer is a 16-bit register. only byte accesses are valid for flmcr1, flmcr2, ebr1, and ebr2, the access requiring 3 cycles. three cycles are required for a byte or word access to ramer, and 6 cycles for a longword access. when a longword write is performed on ramer, 0 must always be written to the lower word (address h'ffff8630). operation is not guaranteed if any other value is written. 1. in modes in which the on-chip flash memory is disabled, a read will return h'00, and writes are invalid. writes are also disabled when the fwe bit is set to 1 in flmcr1. 2. when a high level is input to the fwe pin, the initial value is h'80. 3. when a low level is input to the fwe pin, or if a high level is input and the swe bit in flmcr1 is not set, these registers are initialized to h'00.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 595 of 818 rej09b0273-0500 19.5 register descriptions 19.5.1 flash memory control register 1 (flmcr1) flmcr1 is an 8-bit register used for flash memory operating mode control. program-verify mode or erase-verify mode for addresses h'00000 to h'1ffff is entered by setting swe to 1 when fwe = 1, then setting the ev1 or pv1 bit. program mode for addresses h'00000 to h'1ffff is entered by setting swe to 1 when fwe = 1, then setting the psu1 bit, and finally setting the p1 bit. erase mode for addresses h'00000 to h'1ffff is entered by setting swe to 1 when fwe = 1, then setting the esu1 bit, and finally setting the e1 bit. flmcr1 is initialized by a reset, and in hardware standby mode and software standby mode. its initial value is h'80 when a high level is input to the fwe pin, and h'00 when a low level is input. when on-chip flash memory is disabled, a read will return h'00, and writes are invalid. writes to bits swe, esu1, psu1, ev1, and pv1 in flmcr1 are enabled only when fwe = 1 and swe = 1; writes to the e1 bit only when fwe = 1, swe = 1, and esu1 = 1; and writes to the p1 bit only when fwe = 1, swe = 1, and psu1 = 1. bit:76543210 fwe swe esu1 psu1 ev1 pv1 e1 p1 initial value:1/00000000 r/w: r r/w r/w r/w r/w r/w r/w r/w bit 7?flash write enable bit (fwe): sets hardware protection against flash memory programming/erasing. bit 7: fwe description 0 when a low level is input to the fwe pin (hardware-protected state) 1 when a high level is input to the fwe pin
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 596 of 818 rej09b0273-0500 bit 6?software write enable bit (swe): enables or disables the flash memory. this bit should be set when setting bits 5 to 0, flmcr2 bits 5 to 0, ebr1 bits 3 to 0, and ebr2 bits 7 to 0. bit 6: swe description 0 writes disabled (initial value) 1 writes enabled [setting condition] when fwe = 1 bit 5?erase setup bit 1 (esu1): prepares for a transition to erase mode (applicable addresses: h'00000 to h'1fffff). do not set the swe, psu1, ev1, pv1, e1, or p1 bit at the same time. bit 5: esu1 description 0 erase setup cleared (initial value) 1 erase setup [setting condition] when fwe = 1 and swe = 1 bit 4?program setup bit 1 (psu1): prepares for a transition to program mode (applicable addresses: h'00000 to h'1fffff). do not set the swe, esu1, ev1, pv1, e1, or p1 bit at the same time. bit 4: psu1 description 0 program setup cleared (initial value) 1 program setup [setting condition] when fwe = 1 and swe = 1
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 597 of 818 rej09b0273-0500 bit 3?erase-verify 1 (ev1): selects erase-verify mode transition or clearing (applicable addresses: h'00000 to h'1fffff). do not set the swe, esu1, psu1, pv1, e1, or p1 bit at the same time. bit 3: ev1 description 0 erase-verify mode cleared (initial value) 1 transition to erase-verify mode [setting condition] when fwe = 1 and swe = 1 bit 2?program-verify 1 (pv1): selects program-verify mode transition or clearing (applicable addresses: h'00000 to h'1fffff). (do not set the swe, esu1, psu1, ev1, e1, or p1 bit at the same time. bit 2: pv1 description 0 program-verify mode cleared (initial value) 1 transition to program-verify mode [setting condition] when fwe = 1 and swe = 1 bit 1?erase 1 (e1): selects erase mode transition or clearing (applicable addresses: h'00000 to h'1fffff). do not set the swe, esu1, psu1, ev1, pv1, or p1 bit at the same time. bit 1: e1 description 0 erase mode cleared (initial value) 1 transition to erase mode [setting condition] when fwe = 1, swe = 1, and esu1 = 1
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 598 of 818 rej09b0273-0500 bit 0?program 1 (p1): selects program mode transition or clearing (applicable addresses: h'00000 to h'1fffff). do not set the swe, psu1, esu1, ev1, pv1, or e1 bit at the same time. bit 0: p1 description 0 program mode cleared (initial value) 1 transition to program mode [setting condition] when fwe = 1, swe = 1, and psu1 = 1 19.5.2 flash memory control register 2 (flmcr2) flmcr2 is an 8-bit register used for flash memory operating mode control. program-verify mode or erase-verify mode for addresses h'20000 to h'3ffff is entered by setting swe (flmcr1) to 1 when fwe (flmcr1) = 1, then setting the ev2 or pv2 bit. program mode for addresses h'20000 to h'3ffff is entered by setting swe (flmcr1) to 1 when fwe (flmcr1) = 1, then setting the psu2 bit, and finally setting the p2 bit. erase mode for addresses h'20000 to h'3ffff is entered by setting swe (flmcr1) to 1 when fwe (flmcr1) = 1, then setting the esu2 bit, and finally setting the e2 bit. flmcr2 is initialized to h'00 by a reset, in hardware standby mode and software standby mode, when a low level is input to the fwe pin, and when a high level is input to the fwe pin and the swe bit in flmcr1 is not set (the exception is the fler bit, which is initialized only by a reset and in hardware standby mode). when on-chip flash memory is disabled, a read will return h'00, and writes are invalid. writes to bits swe, esu2, psu2, ev2, and pv2 in flmcr2 are enabled only when fwe (flmcr1) = 1 and swe (flmcr1) = 1; writes to the e2 bit only when fwe (flmcr1) = 1, swe (flmcr1) = 1, and esu2 = 1; and writes to the p2 bit only when fwe (flmcr1) = 1, swe (flmcr1) = 1, and psu2 = 1. bit:76543210 fler ? esu2 psu2 ev2 pv2 e2 p2 initial value:00000000 r/w: r r r/w r/w r/w r/w r/w r/w
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 599 of 818 rej09b0273-0500 bit 7?flash memory error (fler): indicates that an error has occurred during an operation on flash memory (programming or erasing). when fler is set to 1, flash memory goes to the error- protection state. bit 7: fler description 0 flash memory is operating normally. flash memory program/erase protection (error protection) is disabled. [clearing condition] reset or hardware standby mode (initial value) 1 an error has occurred during flash memory programming/erasing. flash memory program/erase protection (error protection) is enabled. [setting condition] see section 19.8.3, error protection. bit 6?reserved: this bit is always read as 0. bit 5?erase setup bit 2 (esu2): prepares for a transition to erase mode (applicable addresses: h'20000 to h'3ffff). do not set the psu2, ev2, pv2, e2, or p2 bit at the same time. bit 5: esu2 description 0 erase setup cleared (initial value) 1 erase setup [setting condition] when fwe = 1 and swe = 1 bit 4?program setup bit 2 (psu2): prepares for a transition to program mode (applicable addresses: h'20000 to h'3ffff). do not set the esu2, ev2, pv2, e2, or p2 bit at the same time. bit 4: psu2 description 0 program setup cleared (initial value) 1 program setup [setting condition] when fwe = 1 and swe = 1
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 600 of 818 rej09b0273-0500 bit 3?erase-verify 2 (ev2): selects erase-verify mode transition or clearing (applicable addresses: h'20000 to h'3ffff). do not set the esu2, psu2, pv2, e2, or p2 bit at the same time. bit 3: ev2 description 0 erase-verify mode cleared (initial value) 1 transition to erase-verify mode [setting condition] when fwe = 1 and swe = 1 bit 2?program-verify 2 (pv2): selects program-verify mode transition or clearing (applicable addresses: h'20000 to h'3ffff). do not set the esu2, psu2, ev2, e2, or p2 bit at the same time. bit 2: pv2 description 0 program-verify mode cleared (initial value) 1 transition to program-verify mode [setting condition] when fwe = 1 and swe = 1 bit 1?erase 2 (e2): selects erase mode transition or clearing (applicable addresses: h'20000 to h'3ffff). do not set the esu2, psu2, ev2, pv2, or p2 bit at the same time. bit 1: e2 description 0 erase mode cleared (initial value) 1 transition to erase mode [setting condition] when fwe = 1, swe = 1, and esu2 = 1
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 601 of 818 rej09b0273-0500 bit 0?program 2 (p2): selects program mode transition or clearing (applicable addresses: h'20000 to h'3ffff). do not set the esu2, psu2, ev2, pv2, or e2 bit at the same time. bit 0: p2 description 0 program mode cleared (initial value) 1 transition to program mode [setting condition] when fwe = 1, swe = 1, and psu2 = 1 19.5.3 erase block register 1 (ebr1) ebr1 is an 8-bit register that specifies the flash memory erase area block by block. ebr1 is initialized to h'00 by a reset, in hardware standby mode and software standby mode, when a low level is input to the fwe pin, and when a high level is input to the fwe pin and the swe bit in flmcr1 is not set. when a bit in ebr1 is set to 1, the corresponding block can be erased. other blocks are erase-protected. only one of the bits of ebr1 and ebr2 combined can be set. do not set more than one bit. when on-chip flash memory is disabled, a read will return h'00, and writes are invalid. the flash memory block configuration is shown in table 19.3. bit:76543210 ???? eb3 eb2 eb1 eb0 initial value:00000000 r/w:rrrrr/wr/wr/wr/w
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 602 of 818 rej09b0273-0500 19.5.4 erase block register 2 (ebr2) ebr2 is an 8-bit register that specifies the flash memory erase area block by block. ebr2 is initialized to h'00 by a reset, in hardware standby mode and software standby mode, when a low level is input to the fwe pin, and when a high level is input to the fwe pin and the swe bit in flmcr1 is not set. when a bit in ebr2 is set to 1, the corresponding block can be erased. other blocks are erase-protected. only one of the bits of ebr1 and ebr2 combined can be set. do not set more than one bit. when on-chip flash memory is disabled, a read will return h'00, and writes are invalid. the flash memory block configuration is shown in table 19.3. bit:76543210 eb11 eb10 eb9 eb8 eb7 eb6 eb5 eb4 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table 19.3 flash memory erase blocks block (size) address eb0 (32 kb) h'000000 ? h'007fff eb1 (32 kb) h'008000 ? h'00ffff eb2 (32 kb) h'010000 ? h'017fff eb3 (32 kb) h'018000 ? h'01ffff eb4 (32 kb) h'020000 ? h'027fff eb5 (32 kb) h'028000 ? h'02ffff eb6 (32 kb) h'030000 ? h'037fff eb7 (28 kb) h'038000 ? h'03efff eb8 (1 kb) h'03f000 ? h'03f3ff eb9 (1 kb) h'03f400 ? h'03f7ff eb10 (1 kb) h'03f800 ? h'03fbff eb11 (1 kb) h'03fc00 ? h'03ffff
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 603 of 818 rej09b0273-0500 19.5.5 ram emulation register (ramer) ramer specifies the area of flash memory to be overlapped with part of ram when emulating real-time flash memory programming. ramer is initialized to h'0000 by a reset and in hardware standby mode. it is not initialized in software standby mode. ramer settings should be made in user mode or user program mode. (for details, see the description of the bsc.) flash memory area divisions are shown in table 19.4. to ensure correct operation of the emulation function, the rom for which ram emulation is performed should not be accessed immediately after this register has been modified. normal execution of an access immediately after register modification is not guaranteed. bit: 15 14 13 12 11 10 9 8 ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 ????? rams ram1 ram0 initial value:00000000 r/w:rrrrrr/wr/wr/w bits 15 to 3?reserved: these bits are always read as 0. bit 2?ram select (rams): specifies selection or non-selection of flash memory emulation in ram. when rams = 1, all flash memory block are program/erase-protected. bit 2: rams description 0 emulation not selected program/erase-protection of all flash memory blocks is disabled (initial value) 1 emulation selected program/erase-protection of all flash memory blocks is enabled
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 604 of 818 rej09b0273-0500 bits 1 and 0?flash memory area selection (ram1, ram0): these bits are used together with bit 2 to select the flash memory area to be overlapped with ram. (see table 19.4.) table 19.4 flash memory area divisions addresses block name rams ram1 ram0 h'ffd800 ? h'ffdbff ram area 1 kb 0 ** h'03f000 ? h'03f3ff eb8 (1 kb) 1 0 0 h'03f400 ? h'03f7ff eb9 (1 kb) 1 0 1 h'03f800 ? h'03fbff eb10 (1 kb) 1 1 0 h'03fc00 ? h'03ffff eb11 (1 kb) 1 1 1 19.6 on-board programming modes when pins are set to on-board programming mode and a reset-start is executed, a transition is made to the on-board programming state in which program/erase/verify operations can be performed on the on-chip flash memory. there are two on-board programming modes: boot mode and user program mode. the pin settings for transition to each of these modes are shown in table 19.5. for a diagram of the transitions to the various flash memory modes, see figure 19.2. table 19.5 setting on-board programming modes mode pll multiple fwe md3 md2 md1 md0 boot mode expanded mode 1 10000 single chip mode 0001 expanded mode 2 0100 single chip mode 0101 expanded mode 4 1000 single chip mode 1001 expanded mode 1 10010 user program mode single chip mode 0011 expanded mode 2 0110 single chip mode 0111 expanded mode 4 1010 single chip mode 1011
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 605 of 818 rej09b0273-0500 19.6.1 boot mode when boot mode is used, the flash memory programming control program must be prepared in the host beforehand. the sci to be used is set to channel asynchronous mode. when a reset-start is executed after the sh7051 pins have been set to boot mode, the boot program built into the sh7051 is started and the programming control program prepared in the host is serially transmitted to the sh7051 via the channel 1 sci. in the sh7051, the programming control program received via the channel 1 sci is written into the programming control program area in on-chip ram. after the transfer is completed, control branches to the start address of the programming control program area and the programming control program execution state is entered (flash memory programming is performed). the transferred programming control program must therefore include coding that follows the programming algorithm given later. the system configuration in boot mode is shown in figure 19.3, and the boot mode execution procedure in figure 19.4. rxd1 txd1 sci1 sh7051 flash memory write data reception verify data transmission host on-chip ram figure 19.3 system configuration in boot mode
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 606 of 818 rej09b0273-0500 note: if a memory cell does not operate normally and cannot be erased, one h'ff byte is transmitted as an erase error, and the erase operation and subsequent operations are halted. start set pins to boot mode and execute reset-start host transfers data (h'00) continuously at prescribed bit rate sh7051 measures low period of h'00 data transmitted by host sh7051 calculates bit rate and sets value in bit rate register after bit rate adjustment, sh7051 transmits one h'00 data byte to host to indicate end of adjustment host confirms normal reception of bit rate adjustment end indication (h'00), and transmits one h'55 data byte after receiving h'55, sh7051 transmits one h'aa data byte to host host transmits number of programming control program bytes (n), upper byte followed by lower byte sh7051 transmits received number of bytes to host as verify data (echo-back) n = 1 host transmits programming control program sequentially in byte units sh7051 transmits received programming control program to host as verify data (echo-back) transfer received programming control program to on-chip ram n = n? no yes end of transmission check flash memory data, and if data has already been written, erase all blocks after confirming that all flash memory data has been erased, sh7051 transmits one h'aa data byte to host execute programming control program transferred to on-chip ram n + 1 n figure 19.4 boot mode execution procedure
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 607 of 818 rej09b0273-0500 automatic sci bit rate adjustment start bit stop bit d0 d1 d2 d3 d4 d5 d6 d7 low period (9 bits) measured (h'00 data) high period (1 or more bits) when boot mode is initiated, the sh7051 measures the low period of the asynchronous sci communication data (h'00) transmitted continuously from the host. the sci transmit/receive format should be set as follows: 8-bit data, 1 stop bit, no parity. the sh7051 calculates the bit rate of the transmission from the host from the measured low period, and transmits one h'00 byte to the host to indicate the end of bit rate adjustment. the host should confirm that this adjustment end indication (h'00) has been received normally, and transmit one h'55 byte to the sh7051. if reception cannot be performed normally, initiate boot mode again (reset), and repeat the above operations. depending on the host ? s transmission bit rate and the sh7051 ? s system clock frequency, there will be a discrepancy between the bit rates of the host and the sh7051. to ensure correct sci operation, the host ? s transfer bit rate should be set to 4800bps, 9600bps. table 19.6 shows host transfer bit rates and system clock frequencies for which automatic adjustment of the sh7051 bit rate is possible. the boot program should be executed within this system clock range. table 19.6 system clock frequencies for which automatic adjustment of sh7051 bit rate is possible host bit rate system clock frequency for which automatic adjustment of sh7051 bit rate is possible 9600bps 8 to 20mhz 4800bps 4 to 20mhz
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 608 of 818 rej09b0273-0500 on-chip ram area divisions in boot mode: in boot mode, the ram area is divided into an area used by the boot program and an area to which the programming control program is transferred via the sci, as shown in figure 19.5. the boot program area cannot be used until the execution state in boot mode switches to the programming control program transferred from the host. h'ffffd800 h'ffffdfff h'ffffffff boot program area ( 2 kbytes) programming control program area (8 kbytes) figure 19.5 ram areas in boot mode note: the boot program area cannot be used until a transition is made to the execution state for the programming control program transferred to ram. note also that the boot program remains in this area of the on-chip ram even after control branches to the programming control program.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 609 of 818 rej09b0273-0500 19.6.2 user program mode after setting fwe, the user should branch to, and execute, the previously prepared programming/erase control program. as the flash memory itself cannot be read while flash memory programming/erasing is being executed, the control program that performs programming and erasing should be run in on-chip ram or external memory. use the following procedure (figure 19.6) to execute the programming control program that writes to flash memory (when transferred to ram). execute user application program execute programming/ erase control program in ram (flash memory rewriting) transfer programming/erase control program to ram fwe = 1 (user program mode) write fwe assessment program and transfer program 1 2 3 4 5 figure 19.6 user program mode execution procedure note: when programming and erasing, start the watchdog timer so that measures can be taken to prevent program runaway, etc. memory cells may not operate normally if overprogrammed or overerased due to program runaway.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 610 of 818 rej09b0273-0500 19.7 programming/erasing flash memory a software method, using the cpu, is employed to program and erase flash memory in the on- board programming modes. there are four flash memory operating modes: program mode, erase mode, program-verify mode, and erase-verify mode. transitions to these modes are made by setting the psu1, esu1, p1, e1, pv1, and ev1 bits in flmcr1 for addresses h'00000 to h'1ffff, or the psu2, esu2, p2, e2, pv2, and ev2 bits in flmcr2 for addresses h'20000 to h'3ffff. the flash memory cannot be read while being programmed or erased. therefore, the program (programming control program) that controls flash memory programming/erasing should be located and executed in on-chip ram or external memory. notes: 1. operation is not guaranteed if setting/resetting of the swe, esu1, psu1, ev1, pv1, e1, and p1 bits in flmcr1, or the esu2, psu2, ev2, pv2, e2, and p2 bits in flmcr2, is executed by a program in flash memory. 2. when programming or erasing, set fwe to 1 (programming/erasing will not be executed if fwe = 0). 3. programming should be performed in the erased state. do not perform additional programming on previously programmed addresses. 4. do not program addresses h'00000 to h'1ffff and h'20000 to h'3ffff simultaneously. operation is not guaranteed if this is done. 19.7.1 program mode (n = 1 for addresses h'0000 to h'1ffff, n = 2 for addresses h'20000 to h'3ffff) when writing data or programs to flash memory, the program/program-verify flowchart shown in figure 19.7 should be followed. performing program operations according to this flowchart will enable data or programs to be written to flash memory without subjecting the device to voltage stress or sacrificing program data reliability. programming should be carried out 32 bytes at a time. following the elapse of 10 s or more after the swe bit is set to 1 in flash memory control register 1 (flmcr1), 32-byte program data is stored in the program data area and reprogram data area, and the 32-byte data in the program data area in ram is written consecutively to the program address (the lower 8 bits of the first address written to must be h'00, h'20, h'40, h'60, h'80, h'a0, h'c0, or h'e0). thirty-two consecutive byte data transfers are performed. the program address and program data are latched in the flash memory. a 32-byte data transfer must be performed even if writing fewer than 32 bytes; in this case, h'ff data must be written to the extra addresses.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 611 of 818 rej09b0273-0500 next, the watchdog timer is set to prevent overprogramming in the event of program runaway, etc. set 6.6 ms as the wdt overflow period. after this, preparation for program mode (program setup) is carried out by setting the psun bit in flmcrn, and after the elapse of 50 s or more, the operating mode is switched to program mode by setting the pn bit in flmcrn. the time during which the pn bit is set is the flash memory programming time. use a fixed 500 s pulse for the write time. 19.7.2 program-verify mode (n = 1 for addresses h'0000 to h'1ffff, n = 2 for addresses h'20000 to h'3ffff) in program-verify mode, the data written in program mode is read to check whether it has been correctly written in the flash memory. after the elapse of a given programming time, the programming mode is exited (the pn bit in flmcrn is cleared, then the psun bit is cleared at least 10 s later). the watchdog timer is cleared after the elapse of 10 s or more, and the operating mode is switched to program-verify mode by setting the pvn bit in flmcrn. before reading in program-verify mode, a dummy write of h'ff data should be made to the addresses to be read. the dummy write should be executed after the elapse of 4 s or more. when the flash memory is read in this state (verify data is read in 32-bit units), the data at the latched address is read. wait at least 2 s after the dummy write before performing this read operation. next, the written data is compared with the verify data, and reprogram data is computed (see figure 19.7) and transferred to the reprogram data area. after 32 bytes of data have been verified, exit program-verify mode, wait for at least 4 s, then clear the swe bit in flmcr1. if reprogramming is necessary, set program mode again, and repeat the program/program-verify sequence as before. however, ensure that the program/program-verify sequence is not repeated more than 400 times on the same bits.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 612 of 818 rej09b0273-0500 set swe-bit of flmcr1 wait 10 s n = 1 m = 0 successively write 32-byte data in rewrite data area in ram to flash memory enable wdt set psu1 (2) bit in flmcr1 (2) wait 50 s set p1 (2) bit in flmcr1 (2) wait 500 s write start clear p1 (2) bit in flmcr1 (2) wait 10 s wait 10 s ng ng ng ng ok ok ok wait 4 s wait 2 s * 4 * 2 * 3 store 32 bytes write data in write data area and rewrite data area * 4 * 1 wait 4 s clear psu1 (2) bit in flmcr1 (2) disable wdt set pv1 (2) bit of flmcr1 (2) perform dummy-write h'ff to verify address clear pv1 (2) bit of flmcr1 (2) clear swe bit om flmcr1 m = 1 write end write data= verify data? 32 byte data verify complete? m = 0? increment address ok clear swe bit in flmcr1 n 400? n n + 1 start ram rewrite data storage area (32 byte) write data storage area (32 byte) transfer rewrite data to rewrite data area operate rewrite data write end write failure read verify data data writes must be performed in the memory- erased state. do not write additional data to an address to which data is already written. notes: source data (d) 0 0 1 1 verify data (v) 0 1 0 1 rewrite data (x) 1 0 1 1 description rewrite should not be performed to bits already written to. write is incomplete; rewrite should be performed. ? left in the erased state. 1. transfer data in a byte unit. the lower eight bits of the start address to which data is written must be h'00, h'20, h'40, h '60, h'80, h'a0, h'c0, or h'e0. transfer 32-byte data even when writing fewer than 32 bytes. in this case, set h'ff in unused addresses. 2. read verify data in logword form (32 bits). 3. even for bits to which data is already written, an additional write should be performed if their verify result is ng. 4. the write data storage area (32 bytes) and rewrite data storage area (32 bytes) must be located in ram. the contents of the rewrite data storage area are rewritten as writing progresses. figure 19.7 program/program-verify flowchart
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 613 of 818 rej09b0273-0500 19.7.3 erase mode (n = 1 for addresses h'0000 to h'1ffff, n = 2 for addresses h'20000 to h'3ffff) when erasing flash memory, the erase/erase-verify flowchart shown in figure 19.8 should be followed. to perform data or program erasure, set the flash memory area to be erased in erase block register n (ebrn) at least 10 s after setting the swe bit to 1 in flash memory control register 1 (flmcr1). next, the watchdog timer is set to prevent overerasing in the event of program runaway, etc. set 6.6 ms as the wdt overflow period. after this, preparation for erase mode (erase setup) is carried out by setting the esun bit in flmcrn, and after the elapse of 200 s or more, the operating mode is switched to erase mode by setting the en bit in flmcrn. the time during which the en bit is set is the flash memory erase time. ensure that the erase time does not exceed 5 ms. note: with flash memory erasing, preprogramming (setting all memory data in the memory to be erased to all ? 0 ? ) is not necessary before starting the erase procedure. 19.7.4 erase-verify mode (n = 1 for addresses h'0000 to h'1ffff, n = 2 for addresses h'20000 to h'3ffff) in erase-verify mode, data is read after memory has been erased to check whether it has been correctly erased. after the elapse of a the erase time, erase mode is exited (the en bit in flmcrn is cleared, then the esun bit is cleared at least 10 s later), the watchdog timer is cleared after the elapse of 10 s or more, and the operating mode is switched to erase-verify mode by setting the evn bit in flmcrn. before reading in erase-verify mode, a dummy write of h'ff data should be made to the addresses to be read. the dummy write should be executed after the elapse of 20 s or more. when the flash memory is read in this state (verify data is read in 32-bit units), the data at the latched address is read. wait at least 2 s after the dummy write before performing this read operation. if the read data has been erased (all ? 1 ? ), a dummy write is performed to the next address, and erase-verify is performed. the erase-verify operation is carried out on all the erase blocks; the erase block register bit for an erased block should be cleared to prevent excessive application of the erase voltage. when verification is completed, exit erase-verify mode, and wait for at least 5 s. if erasure has been completed on all the erase blocks after completing erase-verify operations on all these blocks, clear the swe bit in flmcr1. if there are any unerased blocks, set erase mode again, and repeat the erase/erase-verify sequence as before. however, ensure that the erase/erase-verify sequence is not repeated more than 60 times.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 614 of 818 rej09b0273-0500 end of erasing start set swe bit in flmcr1 set esu1(2) bit in flmcr1(2) set e1(2) bit in flmcr1(2) wait (10) s wait (200) s n = 1 set ebr1(2) enable wdt * 3 wait (5) ms wait (10) s wait (10) s wait (20) s set block start address to verify address wait (2) s wait (5) s * 2 * 4 start erase clear e1(2) bit in flmcr1(2) clear esu1(2) bit in flmcr1(2) set ev1(2) bit in flmcr1(2) h'ff dummy write to verify address read verify data clear ev1(2) bit in flmcr1(2) wait (5) s clear ev1(2) bit in flmcr1(2) clear swe bit in flmcr1 disable wdt halt erase * 1 verify data = all "1"? last address of block? end of erasing of all erase blocks? erase failure clear swe bit in flmcr1 n 61? ng ng ng ng ok ok ok ok n n + 1 increment address notes: 1. preprogramming (setting erase block data to all ? 0 ? ) is not necessary. 2. verify data is read in 32-bit (longword) units. 3. set only one bit in ebr1(2). more than one bit cannot be set. 4. erasing is performed in block units. to erase a number of blocks, each block must be erased in turn. figure 19.8 erase/erase-verify flowchart
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 615 of 818 rej09b0273-0500 19.8 protection there are two kinds of flash memory program/erase protection, hardware protection and software protection. 19.8.1 hardware protection hardware protection refers to a state in which programming/erasing of flash memory is forcibly disabled or aborted. hardware protection is reset by settings in flash memory control register 1 (flmcr1), flash memory control register 2 (flmcr2), erase block register 1 (ebr1), and erase block register 2 (ebr2). the flmcr1, flmcr2, ebr1, and ebr2 settings are retained in the error-protected state. (see table 19.7.) table 19.7 hardware protection functions item description program erase fwe pin protection ? when a low level is input to the fwe pin, flmcr1, flmcr2, ebr1, and ebr2 are initialized, and the program/erase- protected state is entered. yes yes reset/standby protection ? in a reset (including a wdt overflow reset) and in standby mode, flmcr1, flmcr2, ebr1, and ebr2 are initialized, and the program/erase-protected state is entered. ? in a reset via the res pin, the reset state is not entered unless the res pin is held low until oscillation stabilizes after powering on. in the case of a reset during operation, hold the res pin low for the res pulse width specified in the ac characteristics section. yes yes
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 616 of 818 rej09b0273-0500 19.8.2 software protection software protection can be implemented by setting erase block register 1 (ebr1), erase block register 2 (ebr2), and the rams bit in the ram emulation register (ramer). when software protection is in effect, setting the p1 or e1 bit in flash memory control register 1 (flmcr1), or the p2 or e2 bit in flash memory control register 2 (flmcr2), does not cause a transition to program mode or erase mode. (see table 19.8.) table 19.8 software protection functions item description program erase swe pin protection ? clearing the swe bit to 0 in flmcr1 sets the program/erase-protected state for all blocks. ? (execute in on-chip ram or external memory.) yes yes block specification protection ? erase protection can be set for individual blocks by settings in erase block register 1 (ebr1) and erase block register 2 (ebr2). ? setting ebr1 and ebr2 to h'00 places all blocks in the erase-protected state. ? yes emulation protection ? setting the rams bit to 1 in the ram emulation register (ramer) places all blocks in the program/erase-protected state. yes yes
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 617 of 818 rej09b0273-0500 19.8.3 error protection in error protection, an error is detected when sh7051 runaway occurs during flash memory programming/erasing, or operation is not performed in accordance with the program/erase algorithm, and the program/erase operation is aborted. aborting the program/erase operation prevents damage to the flash memory due to overprogramming or overerasing. if the sh7051 malfunctions during flash memory programming/erasing, the fler bit is set to 1 in flmcr2 and the error protection state is entered. the flmcr1, flmcr2, ebr1, and ebr2 settings are retained, but program mode or erase mode is aborted at the point at which the error occurred. program mode or erase mode cannot be re-entered by re-setting the p1, p2, e1, or e2 bit. however, pv1, pv2, ev1, and ev2 bit setting is enabled, and a transition can be made to verify mode. fler bit setting conditions are as follows: 1. when flash memory is read during programming/erasing (including a vector read or instruction fetch) 2. immediately after exception handling (excluding a reset) during programming/erasing 3. when a sleep instruction (including software standby) is executed during programming/erasing 4. when the bus is released during programming/erasing error protection is released only by a reset and in hardware standby mode. figure 19.9 shows the flash memory state transition diagram.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 618 of 818 rej09b0273-0500 rd vf pr er fler = 0 error occurrence res = 0 or hstby = 0 res = 0 or hstby = 0 rd vf pr er fler = 0 program mode erase mode reset or standby (hardware protection) rd vf pr er fler = 1 rd vf pr er fler = 1 error protection mode error protection mode (software standby) software standby mode flmcr1, flmcr2, ebr1, ebr2 initialization state flmcr1, flmcr2, ebr1, ebr2 initialization state software standby mode release rd: memory read possible vf: verify-read possible pr: programming possible er: erasing possible rd : memory read not possible vf : verify-read not possible pr : programming not possible er : erasing not possible legend: res = 0 or hstby = 0 error occurrence (software standby) figure 19.9 flash memory state transitions
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 619 of 818 rej09b0273-0500 19.9 flash memory emulation in ram making a setting in the ram emulation register (ramer) enables part of ram to be overlapped onto the flash memory area so that data to be written to flash memory can be emulated in ram in real time. after the ramer setting has been made, accesses cannot be made from the flash memory area or the ram area overlapping flash memory. emulation can be performed in user mode and user program mode. figure 19.10 shows an example of emulation of real-time flash memory programming. start emulation program end of emulation program tuning ok? yes no set ramer write tuning data to overlap ram execute application program clear ramer write to flash memory emulation block figure 19.10 flowchart for flash memory emulation in ram
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 620 of 818 rej09b0273-0500 h'000000 h'03f000 h'03f400 h'03f800 h'03fc00 h'03ffff flash memory eb0 to eb7 this area can be accessed from both the ram area and flash memory area eb11 eb10 eb9 eb8 h'ffffd800 h'ffffdbff on-chip ram figure 19.11 example of ram overlap operation example in which flash memory block area (eb8) is overlapped 1. set bits rams, ram1, and ram0 in ramer to 1, 0, 0, to overlap part of ram onto the area (eb8) for which real-time programming is required. 2. real-time programming is performed using the overlapping ram. 3. after the program data has been confirmed, the rams bit is cleared, releasing ram overlap. 4. the data written in the overlapping ram is written into the flash memory space (eb8). notes: 1. when the rams bit is set to 1, program/erase protection is enabled for all blocks regardless of the value of ram1 and ram0 (emulation protection). in this state, setting the p1 or e1 bit in flash memory control register 1 (flmcr1), or the p2 or e2 bit in flash memory control register 2 (flmcr2), will not cause a transition to program mode or erase mode. when actually programming or erasing a flash memory area, the rams bit should be cleared to 0. 2. a ram area cannot be erased by execution of software in accordance with the erase algorithm while flash memory emulation in ram is being used.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 621 of 818 rej09b0273-0500 19.10 note on flash memory programming/erasing in the on-board programming modes (user mode and user program mode), nmi input should be disabled to give top priority to the program/erase operations including ram emulation). 19.11 flash memory programmer mode programs and data can be written and erased in programmer mode as well as in the on-board programming modes. in programmer mode, flash memory read mode, auto-program mode, auto- erase mode, and status read mode are supported. in auto-program mode, auto-erase mode, and status read mode, a status polling procedure is used, and in status read mode, detailed internal signals are output after execution of an auto-program or auto-erase operation. in programmer mode, set the mode pins to pllx2 mode (see table 19.9) and input a 6 mhz input clock, so that the sh7051 runs at 12 mhz. table 19.9 shows the pin settings for programmer mode. for the pin names in programmer mode, see section 1.3.3, pin assignments. table 19.9 prom mode pin settings pin names settings mode pins: md3, md2, md1, md0 1101 (pll 2) fwe pin high level input (in auto-program and auto-erase modes) res pin power-on reset circuit xtal, extal, pllv cc , pllcap, pllv ss pins oscillator circuit
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 622 of 818 rej09b0273-0500 19.11.1 socket adapter pin correspondence diagram connect the socket adapter to the chip as shown in figure 19.13. this will enable conversion to a 32-pin arrangement. the on-chip rom memory map is shown in figure 19.12, and the socket adapter pin correspondence diagram in figure 19.13. h'00000000 addresses in mcu mode addresses in programmer mode h'0003ffff h'00000 h'3ffff on-chip rom space 256 kb figure 19.12 on-chip rom memory map
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 623 of 818 rej09b0273-0500 pin no. 118 112 38 36 42 85 86 87 88 90 92 93 94 17 18 19 20 22 24 25 26 27 28 30 32 33 34 35 41 1, 2, 5, 13, 21, 29, 37, 47, 55, 72, 79, 89, 97, 105, 109, 111, 113, 120, 124, 130, 142, 149, 150, 158 7, 15, 23, 31, 39, 49, 57, 64, 70, 81, 91, 99, 107, 115, 119, 136, 144, 152, 164 40 126 108 110 121 122 123 other than the above pin no. 1 26 2 3 31 13 14 15 17 18 19 20 21 12 11 10 9 8 7 6 5 27 24 23 25 4 28 29 22 32 16 30 hn28f101p (32 pins) pin name fwe a9 a16 a15 we i/o0 i/o1 i/o2 i/o3 i/o4 i/o5 i/o6 i/o7 a0 a1 a2 a3 a4 a5 a6 a7 a8 oe a10 a11 a12 a13 a14 ce v cc v ss a17 pin name fwe a9 a16 a15 we d0 d1 d2 d3 d4 d5 d6 d7 a0 a1 a2 a3 a4 a5 a6 a7 a8 oe a10 a11 a12 a13 a14 ce v ss a17 res xtal extal pllv cc pllcap pllv ss n.c.(open) sh7051 (256 kb version) socket adapter (conversion to 32-pin arrangement) power-on reset circuit oscillator circuit pll circuit legend: fwe: flash write enable i/o7 ? i/o0: data input/output a17 ? a0: address input oe : output enable ce : chip enable we : write enable v cc figure 19.13 socket adapter pin correspondence diagram
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 624 of 818 rej09b0273-0500 19.11.2 programmer mode operation table 19.10 shows how the different operating modes are set when using programmer mode, and table 19.11 lists the commands used in programmer mode. details of each mode are given below. ? memory read mode memory read mode supports byte reads. ? auto-program mode auto-program mode supports programming of 128 bytes at a time. status polling is used to confirm the end of auto-programming. ? auto-erase mode auto-erase mode supports automatic erasing of the entire flash memory. status polling is used to confirm the end of auto-programming. ? status read mode status polling is used for auto-programming and auto-erasing, and normal termination can be confirmed by reading the d6 signal. in status read mode, error information is output if an error occurs. table 19.10 settings for various operating modes in programmer mode pin names mode fwe ce ce ce ce oe oe oe oe we we we we d0?d7 a0?a17 read h or l l l h data output ain output disable h or l l h h hi-z x command write h or l l h l data input * ain chip disable h or l h x x hi-z x notes: 1. chip disable is not a standby state; internally, it is an operation state. 2. * ain indicates that there is also address input in auto-program mode. 3. for command writes in auto-program and auto-erase modes, input a high level to the fwe pin.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 625 of 818 rej09b0273-0500 table 19.11 programmer mode commands 1st cycle 2nd cycle command name number of cycles mode address data mode address data memory read mode 1 + n write x h'00 read ra dout auto-program mode 129 write x h'40 write wa din auto-erase mode 2 write x h'20 write x h'20 status read mode 2 write x h'71 write x h'71 notes: 1. in auto-program mode. 129 cycles are required for command writing by a simultaneous 128-byte write. 2. in memory read mode, the number of cycles depends on the number of address write cycles (n). 19.11.3 memory read mode 1. after completion of auto-program/auto-erase/status read operations, a transition is made to the command wait state. when reading memory contents, a transition to memory read mode must first be made with a command write, after which the memory contents are read. 2. in memory read mode, command writes can be performed in the same way as in the command wait state. 3. once memory read mode has been entered, consecutive reads can be performed. 4. after powering on, memory read mode is entered.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 626 of 818 rej09b0273-0500 table 19.12 ac characteristics in transition to memory read mode conditions: v cc = 5.0 v 10%, v ss = 0 v, t a = 25 c 5 c item symbol min max unit notes command write cycle t nxtc 20 s ce hold time t ceh 0ns ce setup time t ces 0ns data hold time t dh 50 ns data setup time t ds 50 ns write pulse width t wep 70 ns we rise time t r 30 ns we fall time t f 30 ns ce oe ce a16 ? a0 oe we i/o7 ? i/o0 note: data is latched on the rising edge of we . t ceh t wep t f t r t ces t nxtc address stable t ds t dh command write memory read mode figure 19.14 timing waveforms for memory read after memory write
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 627 of 818 rej09b0273-0500 table 19.13 ac characteristics in transition from memory read mode to another mode conditions: v cc = 5.0 v 10%, v ss = 0 v, t a = 25 c 5 c item symbol min max unit notes command write cycle t nxtc 20 s ce hold time t ceh 0ns ce setup time t ces 0ns data hold time t dh 50 ns data setup time t ds 50 ns write pulse width t wep 70 ns we rise time t r 30 ns we fall time t f 30 ns ce oe ce a16 ? a0 oe we i/o7 ? i/o0 note: do not enable we and oe at the same time. t ceh t wep t f t r t ces t nxtc address stable t ds t dh other mode command write memory read mode figure 19.15 timing waveforms in transition from memory read mode to another mode
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 628 of 818 rej09b0273-0500 table 19.14 ac characteristics in memory read mode conditions: v cc = 5.0 v 10%, v ss = 0 v, t a = 25 c 5 c item symbol min max unit notes access time t acc 20 s ce output delay time t ce 150 ns oe output delay time t oe 150 ns output disable delay time t df 100 ns data output hold time t oh 5ns ce a16 ? a0 oe we i/o7 ? i/o0 v il v il v ih t acc t acc t oh t oh address stable address stable figure 19.16 ce ce ce ce and oe oe oe oe enable state read timing waveforms
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 629 of 818 rej09b0273-0500 ce a16 ? a0 oe we i/o7 ? i/o0 v ih t acc t ce t oe t oe t ce t acc t oh t df t df t oh address stable address stable figure 19.17 ce ce ce ce and oe oe oe oe clock system read timing waveforms 19.11.4 auto-program mode 1. in auto-program mode, 128 bytes are programmed simultaneously. this should be carried out by executing 128 consecutive byte transfers. 2. a 128-byte data transfer is necessary even when programming fewer than 128 bytes. in this case, h'ff data must be written to the extra addresses. 3. the lower 7 bits of the transfer address must be low. if a value other than an effective address is input, processing will switch to a memory write operation but a write error will be flagged. 4. memory address transfer is performed in the third cycle (figure 18.13). do not perform transfer after the second cycle. 5. do not perform a command write during a programming operation. 6. perform one auto-program operation for a 128-byte block for each address. two or more additional programming operations cannot be performed on a previously programmed address block. 7. confirm normal end of auto-programming by checking d6. alternatively, status read mode can also be used for this purpose (d7 status polling uses the auto-program operation end identification pin). 8. status polling d6 and d7 pin information is retained until the next command write. as long as the next command write has not been performed, reading is possible by enabling ce and oe .
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 630 of 818 rej09b0273-0500 table 19.15 ac characteristics in auto-program mode conditions: v cc = 5.0 v 10%, v ss = 0 v, t a = 25 c 5 c item symbol min max unit notes command write cycle t nxtc 20 s ce hold time t ceh 0ns ce setup time t ces 0ns data hold time t dh 50 ns data setup time t ds 50 ns write pulse width t wep 70 ns status polling start time t wsts 1ms status polling access time t spa 150 ns address setup time t as 0ns address hold time t ah 60 ns memory write time t write 1 3000 ms write setup time t pns 100 ns write end setup time t pnh 100 ns we rise time t r 30 ns we fall time t f 30 ns
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 631 of 818 rej09b0273-0500 ce a16 ? a0 fwe oe we i/o7 i/o6 i/o5 ? i/o0 t pns t wep t ds t dh t f t r t as t ah t wsts t write t spa t ces t ceh t nxtc t nxtc t pnh address stable h'40 h'00 data transfer 1 to 128byte write operation complete verify signal write normal complete verify signal figure 19.18 auto-program mode timing waveforms 19.11.5 auto-erase mode 1. auto-erase mode supports only entire memory erasing. 2. do not perform a command write during auto-erasing.. 3. confirm normal end of auto-erasing by checking d6. alternatively, status read mode can also be used for this purpose (d7 status polling uses the auto-erase operation end identification pin). 4. status polling d6 and d7 pin information is retained until the next command write. as long as the next command write has not been performed, reading is possible by enabling ce and oe .
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 632 of 818 rej09b0273-0500 table 19.16 ac characteristics in auto-erase mode conditions: v cc = 5.0 v 10%, v ss = 0 v, t a = 25 c 5 c item symbol min max unit notes command write cycle t nxtc 20 s ce hold time t ceh 0ns ce setup time t ces 0ns data hold time t dh 50 ns data setup time t ds 50 ns write pulse width t wep 70 ns status polling start time t ests 1ms status polling access time t spa 150 ns memory erase time t erase 100 40000 ms erase setup time t ens 100 ns erase end setup time t enh 100 ns we rise time t r 30 ns we fall time t f 30 ns
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 633 of 818 rej09b0273-0500 ce a16 ? a0 fwe oe we i/o7 i/o6 i/o5 ? i/o0 t ens t wep t ds t dh t f t r t ests t erase t spa t ces t ceh t nxtc t nxtc t enh h'20 h'20 h'00 erase complete verify signal erase normal complete verify signal figure 19.19 auto-erase mode timing waveforms 19.11.6 status read mode 1. status read mode is provided to specify the kind of abnormal end. use this mode when an abnormal end occurs in auto-program mode or auto-erase mode. 2. the return code is retained until a command write other than a status read mode command write is executed.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 634 of 818 rej09b0273-0500 table 19.17 ac characteristics in status read mode conditions: v cc = 5.0 v 10%, v ss = 0 v, t a = 25 c 5 c item symbol min max unit notes read time after command write t std 20 s ce hold time t ceh 0ns ce setup time t ces 0ns data hold time t dh 50 ns data setup time t ds 50 ns write pulse width t wep 70 ns oe output delay time t oe 150 ns disable delay time t df 100 ns ce output delay time t ce 150 ns we rise time t r 30 ns we fall time t f 30 ns ce a16 ? a0 oe we i/o7 ? i/o0 t wep t f t r t oe t df t ds t ds t dh t dh t ces t ceh t ce t ceh t nxtc t nxtc t nxtc t ces h'71 t wep t f t r h'71 note: i/o2 and i/o3 are undefined. figure 19.20 status read mode timing waveforms
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 635 of 818 rej09b0273-0500 table 19.18 status read mode return commands pin name d7 d6 d5 d4 d3 d2 d1 d0 attribute normal end identification command error program- ming error erase error ?? program- ming or erase count exceeded effective address error initial value 0 0 0 0 0 0 0 0 indications normal end: 0 abnormal end: 1 command error: 1 otherwise: 0 program- ming error: 1 otherwise: 0 erasing error: 1 otherwise: 0 ?? count exceeded: 1 otherwise: 0 effective address error: 1 otherwise: 0 note: d2 and d3 are undefined at present. 19.11.7 status polling 1. d7 status polling is a flag that indicates the operating status in auto-program/auto-erase mode. 2. d6 status polling is a flag that indicates a normal or abnormal end in auto-program/auto-erase mode. table 19.19 status polling output truth table pin name during internal operation abnormal end ? normal end d70101 d60011 d0 ? d50000
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 636 of 818 rej09b0273-0500 19.11.8 programmer mode transition time commands cannot be accepted during the oscillation stabilization period or the programmer mode setup period. after the programmer mode setup time, a transition is made to memory read mode. table 19.20 stipulated transition times to command wait state item symbol min max unit notes standby release (oscillation stabilization time) t osc1 10 ms programmer mode setup time t bmv 10 ms v cc hold time t dwn 0ms t osc1 t bmv t dwn v cc res fwe memory read mode command wait state automatic write mode automatic erase mode command wait state normal/abnormal complete verify note : for the level of fwe input pin, set v il when using other than the automatic write mode and automatic erase mode. figure 19.21 oscillation stabilization time, boot program transfer time, and power- down sequence
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 637 of 818 rej09b0273-0500 19.11.9 cautions concerning memory programming 1. when programming addresses which have previously been programmed, carry out auto- erasing before auto-programming. 2. when performing programming using prom mode on a chip that has been programmed/erased in an on-board programming mode, auto-erasing is recommended before carrying out auto-programming. notes: 1. the flash memory is initially in the erased state when the device is shipped by renesas. for other chips for which the erasure history is unknown, it is recommended that auto- erasing be executed to check and supplement the initialization (erase) level. 2. auto-programming should be performed once only on the same address block. additional programming cannot be performed on previously programmed address blocks. 19.12 notes when converting the f-ztat application software to the mask-rom versions please note the following when converting the f-ztat application software to the mask-rom versions. the values read from the internal registers for the flash rom of the mask-rom version and f- ztat version differ as follows. status register bit f-ztat version mask-rom version flmcr1 fwe 0: application software running 1: programming 0: is not read out 1: application software running note: this difference applies to all the f-ztat versions and all the mask-rom versions that have different rom size.
section 19 rom (256 kb version) rev. 5.00 jan 06, 2006 page 638 of 818 rej09b0273-0500
section 20 ram rev. 5.00 jan 06, 2006 page 639 of 818 rej09b0273-0500 section 20 ram 20.1 overview the sh7050 has 6 kbytes/the sh7051 has 10 kbytes of on-chip ram. the on-chip ram is linked to the cpu and direct memory access controller (dmac) with a 32-bit data bus (figure 20.1). the cpu can access data in the on-chip ram in 8, 16, or 32 bit widths. the dmac can access 8 or 16 bit widths. on-chip ram data can always be accessed in one state, making the ram ideal for use as a program area, stack area, or data area, which require high-speed access. the contents of the on-chip ram are held in both the sleep and software standby modes. when the rame bit (see below) is cleared to 0, the on-chip ram contents are also held in hardware standby mode. memory area 0 addresses h'fffff800 to h'ffffffff (sh7050) and h'ffff0800 to h'ffffffff (sh7051) are allocated to the on-chip ram. h'fffff800 h'fffff804 h'fffff801 h'fffff805 h'fffff802 h'fffff806 h'fffff803 h'fffff807 h'fffffffc h'fffffffd h'fffffffe h'ffffffff on-chip ram internal data bus (32 bits) sh7050 sh7051 h'ffffd800 h'ffffd804 h'ffffd801 h'ffffd805 h'ffffd802 h'ffffd806 h'ffffd803 h'ffffd807 h'fffffffc h'fffffffd h'fffffffe h'ffffffff on-chip ram internal data bus (32 bits) figure 20.1 block diagram of ram
section 20 ram rev. 5.00 jan 06, 2006 page 640 of 818 rej09b0273-0500 20.2 operation the on-chip ram is controlled by means of the system control register (syscr). when the rame bit in syscr is set to 1, the on-chip ram is enabled. accesses to addresses h'ffffe800?h'ffffffff (sh7050) and h'ffffd800?h'ffffffff (sh7051) are then directed to the on-chip ram. when the rame bit in syscr is cleared to 0, the on-chip ram is not accessed. a read will return an undefined value, and a write is invalid. if a transition is made to hardware standby mode after the rame bit in syscr is cleared to 0, the contents of the on-chip ram are held. for details of syscr, see 21.2.2, system control register (syscr), in section 21, power-down state.
section 21 power-down state rev. 5.00 jan 06, 2006 page 641 of 818 rej09b0273-0500 section 21 power-down state 21.1 overview in the power-down state, the cpu functions are halted. this enables a great reduction in power consumption. 21.1.1 power-down states the power-down state is effected by the following three modes: 1. hardware standby mode a transition to hardware standby mode is made according to the input level of the res and hstby pins. in hardware standby mode, all chip functions are halted. this state is exited by means of a power-on reset. 2. software standby mode a transition to software standby mode is made by means of software (a cpu instruction). in software standby mode, all chip functions are halted. this state is exited by means of a power-on reset or an nmi interrupt. 3. sleep mode a transition to sleep mode is made by means of a cpu instruction. in software standby mode, basically only the cpu is halted, and all on-chip peripheral modules operate. this state is exited by means of a power-on reset, interrupt, or dma address error. table 21.1 describes the transition conditions for entering the modes from the program execution state as well as the cpu and peripheral function status in each mode and the procedures for canceling each mode.
section 21 power-down state rev. 5.00 jan 06, 2006 page 642 of 818 rej09b0273-0500 table 21.1 power-down state conditions state mode entering procedure clock cpu cpu registers on-chip peripheral modules ram i/o ports canceling procedure hardware standby low-level input at hstby pin halted halted halted undefined held * 2 initialized high-level input at hstby pin, executing power-on reset software standby execute sleep instruction with sby bit set to 1 in sbycr halt halt held halt * 1 held held or high impe- dance * 3 ?nmi interrupt  power-on reset sleep execute sleep instruction with sby bit set to 0 in sbycr run halt held run held held  interrupt dmac address error  power-on reset notes: 1. sbycr: standby control register. sby: standby bit 2. some bits within on-chip peripheral module registers are initialized by the standby mode; some are not. refer to table 21.3, register states in the standby mode, in section 21.4.1, transition to standby mode. also refer to the register descriptions for each peripheral module. 3. the status of the i/o port in standby mode is set by the port high impedance bit (hiz) of the sbycr. refer to section 21.2, standby control register (sbycr). for pin status other than for the i/o port, refer to appendix b, pin states.
section 21 power-down state rev. 5.00 jan 06, 2006 page 643 of 818 rej09b0273-0500 21.1.2 pin configuration pins related to power-down modes are shown in table 21.2. table 21.2 pin configuration pin name abbreviation i/o function hardware standby input pin hstby input input level determines transition to hardware standby mode. power-on reset input pin res input power-on reset signal input pin 21.1.3 related register table 21.3 shows the register used for power-down state control. table 21.3 related register name abbreviation r/w initial value address access size standby control register sbycr r/w h'1f h'ffff8614 8 system control register syscr r/w h'01 h'ffff83c8 8 note: sbycr is accessed in three cycles , and syscr in two cycles.
section 21 power-down state rev. 5.00 jan 06, 2006 page 644 of 818 rej09b0273-0500 21.2 register descriptions 21.2.1 standby control register (sbycr) the standby control register (sbycr) is a read/write 8-bit register that sets the transition to standby mode, and the port status in standby mode. the sbycr is initialized to h'1f by reset. bit:76543210 ssby hiz ?????? initial value:00011111 r/w:r/wr/wrrrrrr bit 7?standby (ssby): specifies transition to the standby mode. the ssby bit cannot be set to 1 while the watchdog timer is running (when the timer enable bit (tme) of the wdt timer control/status register (tcsr) is set to 1). to enter the standby mode, always halt the wdt by 0 clearing the tme bit, then set the ssby bit. bit 7: ssby description 0 executing sleep instruction puts the lsi into sleep mode (initial value) 1 executing sleep instruction puts the lsi into standby mode bit 6?port high impedance (hiz): in the standby mode, this bit selects whether to set the i/o port pin to high impedance or hold the pin status. the hiz bit cannot be set to 1 when the tme bit of the wdt timer control/status register (tcsr) is set to 1. when making the i/o port pin status high impedance, always clear the tme bit to 0 before setting the hiz bit. bit 6: hiz description 0 holds pin status while in standby mode (initial value) 1 keeps pin at high impedance while in standby mode bits 5?0?reserved: bit 5 always reads as 0. always write 0 to bit 5. bits 4?0 always read as 1. always write 1 to these bits.
section 21 power-down state rev. 5.00 jan 06, 2006 page 645 of 818 rej09b0273-0500 21.2.2 system control register (syscr) bit:76543210 ???????rame initial value:00000001 r/w:rrrrrrrr/w the system control register (syscr) is an 8-bit readable/writable register that enables or disables accesses to the on-chip ram. syscr is initialized to h'01 by the rising edge of a power-on reset. bits 7 to 1?reserved: these bits are always read as 0, and should only be written with 0. bit 0?rame enable (rame): selects enabling or disabling of the on-chip ram. when rame is set to 1, on-chip ram is enabled. when rame is cleared to 0, on-chip ram cannot be accessed. in this case, a read or instruction fetch from on-chip ram will return an undefined value, and a write to on-chip ram will be ignored. the initial value of rame is 1. when on-chip ram is disabled by clearing rame to 0, do not place an instruction that attempts to access on-chip ram immediately after the syscr write instruction, as normal access cannot be guaranteed in this case. when on-chip ram is enabled by setting rame to 1, place an syscr read instruction immediately after the syscr write instruction. normal access cannot be guaranteed if an on-chip ram access instruction is placed immediately after the syscr write instruction. bit 0: rame description 0 on-chip ram disabled 1 on-chip ram enabled (initial value)
section 21 power-down state rev. 5.00 jan 06, 2006 page 646 of 818 rej09b0273-0500 21.3 hardware standby mode 21.3.1 transition to hardware standby mode the chip enters hardware standby mode when the hstby pin goes low. hardware standby mode reduces power consumption drastically by halting all chip functions. as the transition to hardware standby mode is made by means of external pin input, the transition is made asynchronously, regardless of the current state of the chip, and therefore the chip state prior to the transition is not preserved. however, on-chip ram data is retained as long as the specified voltage is supplied. to retain on-chip ram data, clear the ram enable bit (rame) to 0 in the system control register (syscr) before driving the hstby pin low. see ?pin states? for the pin states in hardware standby mode. 21.3.2 exit from hardware standby mode hardware standby mode is exited by means of the hstby pin and res pin. when hstby is driven high while res is low, the clock oscillator starts running. the res pin should be held low long enough for clock oscillation to stabilize. when res is driven high, power-on reset exception handling is started and a transition is made to the program execution state. 21.3.3 hardware standby mode timing figure 21.1 shows sample pin timings for hardware standby mode. a transition to hardware standby mode is made by driving the hstby pin low after driving the res pin low. hardware standby mode is exited by driving hstby high, waiting for clock oscillation to stabilize, then switching res from low to high.
section 21 power-down state rev. 5.00 jan 06, 2006 page 647 of 818 rej09b0273-0500 oscillator res hstby res pulse width t resw oscillation stabilization time reset exception handling figure 21.1 hardware standby mode timing 21.4 software standby mode 21.4.1 transition to software standby mode to enter the standby mode, set the sby bit to 1 in sbycr, then execute the sleep instruction. the lsi moves from the program execution state to the standby mode. in the standby mode, power consumption is greatly reduced by halting not only the cpu, but the clock and on-chip peripheral modules as well. cpu register contents and on-chip ram data are held as long as the prescribed voltages are applied (when the rame bit in syscr is 0). the register contents of some on-chip peripheral modules are initialized, but some are not (table 21.4). the i/o port status can be selected as held or high impedance by the port high impedance bit (hiz) of the sbycr. for pin status other than for the i/o port, refer to appendix b, pin states.
section 21 power-down state rev. 5.00 jan 06, 2006 page 648 of 818 rej09b0273-0500 table 21.4 register states in the standby mode module registers initialized registers that retain data interrupt controller (intc) ? all registers user break controller (ubc) ? all registers bus state controller (bsc) ? all registers direct memory access controller (dmac) all registers ? advanced timer unit (atu) all registers ? advanced pulse controller ? all registers watchdog timer (wdt) ? bits 7 ? 5 (ovf, wt/ it , tme) of the timer control status register (tcsr) ? reset control/status register (rstcsr) ? timer counter (tcnt) ? bits 2 ? 0 (cks2 ? cks0) of the tcsr compare match timer (cmt) all registers ? serial communication interface (sci) all registers ? a/d converter (a/d) all registers ? pin function controller (pfc) ? all registers i/o port (i/o) ? all registers power-down state related ? ? standby control register (sbycr) ? system control register (syscr)
section 21 power-down state rev. 5.00 jan 06, 2006 page 649 of 818 rej09b0273-0500 21.4.2 canceling the software standby mode the standby mode is canceled by an nmi interrupt, a power-on reset, or a manual reset. cancellation by an nmi: clock oscillation starts when a rising edge or falling edge (selected by the nmi edge select bit (nmie) of the interrupt control register (icr) of the intc) is detected in the nmi signal. this clock is supplied only to the watchdog timer. a wdt overflow occurs if the time established by the clock select bits (cks2?cks0) in the tcsr of the wdt elapses before transition to the standby mode. the occurrence of this overflow is used to indicate that the clock has stabilized, so the clock is supplied to the entire chip, the standby mode is canceled, and nmi exception processing begins. when canceling standby mode with nmi interrupts, set the cks2?cks0 bits so that the wdt overflow period is longer than the oscillation stabilization time. when canceling standby mode with an nmi pin set for falling edge, be sure that the nmi pin level upon entering standby (when the clock is halted) is high level, and that the nmi pin level upon returning from standby (when the clock starts after oscillation stabilization) is low level. when canceling standby mode with an nmi pin set for rising edge, be sure that the nmi pin level upon entering standby (when the clock is halted) is low level, and that the nmi pin level upon returning from standby (when the clock starts after oscillation stabilization) is high level. cancellation by a power-on reset: a power-on reset caused by setting the res pin to low level cancels the standby mode.
section 21 power-down state rev. 5.00 jan 06, 2006 page 650 of 818 rej09b0273-0500 21.4.3 software standby mode application example this example describes a transition to standby mode on the falling edge of an nmi signal, and a cancellation on the rising edge of the nmi signal. the timing is shown in figure 21.2. when the nmi pin is changed from high to low level while the nmi edge select bit (nmie) of the icr is set to 0 (falling edge detection), the nmi interrupt is accepted. when the nmie bit is set to 1 (rising edge detection) by an nmi exception service routine, the standby bit (sby) of the sbycr is set to 1, and a sleep instruction is executed, standby mode is entered. thereafter, standby mode is canceled when the nmi pin is changed from low to high level. oscillator ck nmi pin nmie bit ssby bit chip state oscillation start time program execution exception service routine software standby mode wdt set time nmi exception handling nmi exception handling oscillation settling time figure 21.2 standby mode nmi timing (application example)
section 21 power-down state rev. 5.00 jan 06, 2006 page 651 of 818 rej09b0273-0500 21.5 sleep mode 21.5.1 transition to sleep mode executing the sleep instruction when the sby bit of sbycr is 0 causes a transition from the program execution state to the sleep mode. although the cpu halts immediately after executing the sleep instruction, the contents of its internal registers remain unchanged. the on-chip peripheral modules continue to run during the sleep mode. 21.5.2 canceling sleep mode cancellation by an interrupt: when an interrupt occurs, the sleep mode is canceled and interrupt exception processing is executed. the sleep mode is not canceled if the interrupt cannot be accepted because its priority level is equal to or less than the mask level set in the cpu?s status register (sr) or if an interrupt by an on-chip peripheral module is disabled at the peripheral module. cancellation by a dmac address error: if a dmac address error occurs, the sleep mode is canceled and dmac address error exception processing is executed. cancellation by a power-on reset: a power-on reset resulting from setting the res pin to low level cancels the sleep mode.
section 21 power-down state rev. 5.00 jan 06, 2006 page 652 of 818 rej09b0273-0500
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 653 of 818 rej09b0273-0500 section 22 electrical characteristics 22.1 absolute maximum ratings table 22.1 shows the absolute maximum ratings. table 22.1 absolute maximum ratings item symbol rating unit power supply voltage v cc ?0.3 to +7.0 v input voltage (other than a/d ports) v in ?0.3 to v cc + 0.3 v input voltage (a/d ports) v in ?0.3 to av cc + 0.3 v analog supply voltage av cc ?0.3 to +7.0 v analog reference voltage av ref ?0.3 to av cc + 0.3 v analog input voltage v an ?0.3 to av cc + 0.3 v operating temperature (exclding overwrite) t opr ?40 to +85 c overwrite temperature t we ?20 to +85 c storage temperature t stg ?55 to +125 c note: operating the lsi in excess of the absolute maximum ratings may result in permanent damage.
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 654 of 818 rej09b0273-0500 22.2 dc characteristics table 22.2 dc characteristics conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?40 to +85c item pin symbol min typ max unit measurement conditions input high- level voltage res , nmi, md3?md0, hstby v ih v cc ? 0.7 ? v cc + 0.3 v ? extal v cc 0.7 ? v cc + 0.3 v ? a/d port 2.2 ? av cc + 0.3 v ? other input pins 2.2 ? v cc + 0.3 v ? input low- level voltage res , nmi, md3?md0, hstby v il ?0.3 ? 0.5 v ? other input pins ?0.3 ? 0.8 v ? vt + 4.0 ? ? v ? vt ? ??1.0v? schmitt trigger input voltage tia0?tid0, tioa1?tiof1, tioa2?tiof2, tioa3?tiof3, tioa4?tiof4, tioa5, tiob5, tclka, tclkb vt + ? vt ? 0.4 ? ? v ? input leak current res , nmi, md3?md0, hstby | iin | ? ? 1.0 a vin = 0.5 to v cc ? 0.5 v a/d port ? ? 1.0 a vin = 0.5 to av cc ? 0.5 v other input pins ? ? 1.0 a vin = 0.5 to v cc ? 0.5 v three- state leak current (while off) a21?a0, d15?d0, cs3 ? cs0 , wrh , wr l, rd | i tsi | ? ? 1.0 a vin = 0.5 to v cc ? 0.5 v
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 655 of 818 rej09b0273-0500 item pin symbol min typ max unit measurement conditions all output pins v oh v cc ? 0.5 ? ? v i oh = ?200 a output high-level voltage 3.5 ? ? v i oh = ?1 ma all output pins v ol ??0.4vi ol = 1.6 ma output low-level voltage ??1.2vi ol = 8 ma res cin ? ? 60 pf nmi ? ? 30 pf input capacitance all other input pins ? ? 20 pf vin = 0 v, f = 1 mhz, ta = 25c ordinary operation i cc ? 100 (90) * 150 ma f = 20 mhz current consump- tion sleep ? 80 (70) * 130 ma f = 20 mhz standby ? 1 20 a ta 50c ? ? 80 a ta > 50c write operation ? 110 150 a ?20c ta 85c f = 20 mhz during a/d conversion ai cc ?1.55 ma analog supply current awaiting a/d conversion ?0.55 a during a/d conversion ai ref ?1.05 maav ref = 5.0 v reference power supply current awaiting a/d conversion ?0.55 a ram standby voltage v ram 2.0 ? ? v note: * mask version
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 656 of 818 rej09b0273-0500 table 22.3 permitted output current values conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?40 to +85c item symbol min typ max unit output low-level permissible current (per pin) i ol ??8.0ma output low-level permissible current (total) i ol ??80ma output high-level permissible current (per pin) ?i oh ??2.0ma output high-level permissible current (total) (?i oh )??25ma note: to assure lsi reliability, do not exceed the output values listed in this table. 22.2.1 notes on using 1. when the a/d converter is not used (including during standby), do not release the av cc , av ss , and av ref pins. connect the av cc and av ref pins to v cc and the av ss pin to v ss . 2. the current consumption is measured when v ih min = v cc ? 0.5 v, v il max = 0.5 v, with all output pins unloaded.
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 657 of 818 rej09b0273-0500 22.3 ac characteristics input output reference voltage level and loading current of ac characteristics measuring conditions are same as defined in figure 22.22. 22.3.1 clock timing table 22.4 clock timing conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?40 to +85c item symbol min max unit figures operating frequency f op 4 20 mhz 22.1 clock cycle time t cyc 50 250 ns clock low-level pulse width t cl 20 ? ns clock high-level pulse width t ch 20 ? ns clock rise time t cr ?5 ns clock fall time t cf ?5 ns extal clock input frequency f ex 4 10 mhz 22.2 extal clock input cycle time t excyc 100 250 ns extal clock low-level input pulse width t exl 30 ? ns extal clock high-level input pulse width t exh 30 ? ns extal clock input rise time t exr ?5 ns extal clock input fall time t exf ?5 ns reset oscillation settling time t osc1 10 ? ms 22.3 standby return clock settling time t osc2 10 ? ms
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 658 of 818 rej09b0273-0500 t cl t cyc t ch ck 1/2 v cc t cf t cr 1/2 v cc figure 22.1 system clock timing t exl t exh extal 1/2 v cc t exf t exr 1/2 v cc t excyc figure 22.2 extal clock input timing ck v cc v cc min t osc1 t osc1 t osc2 h stby res figure 22.3 oscillation settling time
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 659 of 818 rej09b0273-0500 22.3.2 control signal timing table 22.5 control signal timing conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?40 to +85c item symbol min max unit figure res pulse width t resw 20 ? t cyc 22.4 res setup time t ress 30 ? ns nmi setup time * t nmis 30 ? ns 22.4, 22.5 irq7 ? irq0 setup time (edge detection) * t irqes 30 ? ns irq7 ? irq0 setup time (level detection) * t irqls 30 ? ns nmi hold time t nmih 50 ? ns 22.5 irq7 ? irq0 hold time t irqeh 30 ? ns irqout hold time t irqod ? 25 ns 22.6 bus request setup time t brqs 30 ? ns 22.7 bus acknowledge delay time 1 t backd1 ? 25 ns bus acknowledge delay time 2 t backd2 ? 25 ns bus three-state delay time t bzd ? 50 ns note: * the res , nmi, and irq7 ? irq0 signals are asynchronous inputs, but when the setup times shown here are provided, the signals are considered to have produced changes at clock fall. if the setup times are not provided, recognition is delayed until the next clock rise or fall. t ress v ih v ih v il v il t resw t ress ck res figure 22.4 reset input timing
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 660 of 818 rej09b0273-0500 t nmih v ih ck t nmis v il v ih v il t irqeh t irqes t irqls nmi irq edge irq level figure 22.5 interrupt signal input timing t irqod ck t irqod i rqout figure 22.6 interrupt signal output timing
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 661 of 818 rej09b0273-0500 ck t brqs t brqs t backd2 t backd1 t bzd t bzd breq (input) back (output) a21 ? a0, d15 ? d0 rd , csn , w rh , wrl figure 22.7 bus right release timing
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 662 of 818 rej09b0273-0500 22.3.3 bus timing table 22.6 bus timing conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av ref = 4.5 v ? av cc , v ss = av ss = 0 v, ta = ?40 to +85 c item symbol min max unit figure address delay time t ad ? 25 ns 22.8, 22.9 cs delay time 1 t csd1 ? 25 ns cs delay time 2 t csd2 ? 25 ns read strobe delay time 1 t rsd1 ? 25 ns read strobe delay time 2 t rsd2 ? 25 ns read data setup time t rds 28 ? ns read data hold time t rdh 0 ? ns write address setup time t as 0 ? ns write address hold time t wr 5 ? ns write strobe delay time 1 t wsd1 ? 25 ns write strobe delay time 2 t wsd2 ? 25 ns write data delay time t wdd ? 35 ns write data hold time t wdh t cyc m ? ns wait setup time t wts 15 ? ns 22.10 wait hold time t wth 0 ? ns read data access time t acc t cyc (n + 2) ? 45 ? ns 22.8, 22.9 access time from read strobe t oe t cyc (n + 1.5) ? 45 ? ns dack delay time t dackd1 ? 25 ns note: n is the number of waits. m=1: cs assort extended cycle m=0: normal cycle (cs assort non-extended cycle)
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 663 of 818 rej09b0273-0500 ck t rsd1 a21 ? a0 t1 t2 t oe t rsd2 t csd2 t csd1 t ad t rdh t rds t acc t wsd1 t as t wsd2 t wdd t wdh t dackd t dackd d15 ? d0 (during read) note: t rdh is specified from the first negate timing for a21 ? a0, csn , and rd . csn rd (during read) wrx (during write) d15 ? d0 (during write) dackn t wr figure 22.8 basic cycle (no waits)
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 664 of 818 rej09b0273-0500 ck t rsd1 a21 ? a0 t1 tw t oe t rsd2 t csd2 t csd1 t ad t rdh t rds t acc t wsd1 t wsd2 t wr t wdd t as t wdh t dackd t dackd d15 ? d0 (during read) t2 csn rd (during read) wrx (during write) d15 ? d0 (during write) dackn note: t rdh is specified from the first negate timing for a21 e a0, csn , and rd . figure 22.9 basic cycle (software waits)
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 665 of 818 rej09b0273-0500 ck a21 ? a0 t1 tw d15 ? d0 (during read) t2 tw t wts d15 ? d0 (during write) two t wth t wts t wth csn rd (during read) wrx (during write) wait dackn figure 22.10 basic cycle (2 software waits + wait due to wait wait wait wait signal)
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 666 of 818 rej09b0273-0500 22.3.4 direct memory access controller timing table 22.7 direct memory access controller timing conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?40 to +85 c item symbol min max unit figure dreq0 and dreq1 setup time t drqs 27 ? ns 22.11 dreq0 and dreq1 hold time t drqh 30 ? ns dreq0 and dreq1 pulse width t drqw 1.5 ? t cyc 22.12 drak output delay time t drakd ? 25 ns 22.13 t drqs t drqs ck dreq0 , dreq1 level dreq0 , dreq1 edge dreq0 , dreq1 level release t drqs t drqh figure 22.11 dreq0 and dreq1 input timing (1)
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 667 of 818 rej09b0273-0500 t drqw ck d req0 , dreq1 edge figure 22.12 dreq0 and dreq1 input timing (2) ck t drakd t drakd drakn figure 22.13 drak output delay time
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 668 of 818 rej09b0273-0500 22.3.5 advanced timer unit timing and advanced pulse controller timing table 22.8 advanced timer unit timing and advanced pulse controller timing conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?40 to +85 c item symbol min max unit figure output compare output delay time t tocd ? 50 ns 22.14 input capture input setup time t tics 35 ? ns puls output delay time t plsd ? 50 ns timer input setup time t tcks 50 ? ns 22.15 timer clock pulse width (single edge specification) t tckwh/l 1.5 ? t cyc timer clock pulse width (both edges specified) t tckwh/l 2.5 ? t cyc t tocd ck timer output input capture input puls output t tics t plsd figure 22.14 atu i/o timing
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 669 of 818 rej09b0273-0500 t tcks t tcks t tckwh t tckwl ck tclka, tclkb figure 22.15 atu clock input timing 22.3.6 i/o port timing table 22.9 i/o port timing conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?40 to +85 c item symbol min max unit figure port output data delay time t pwd ? 100 ns 22.16 port input hold time t prh 50 ? ns port input setup time t prs 50 ? ns t prs t prh t pwd ck port (read) port (write) figure 22.16 i/o port i/o timing
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 670 of 818 rej09b0273-0500 22.3.7 watchdog timer timing table 22.10 watchdog timer timing conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?40 to +85 c item symbol min max unit figure wdtovf delay time t wovd ? 100 ns 22.17 t wovd t wovd ck wdtovf figure 22.17 watchdog timer timing 22.3.8 serial communication interface timing table 22.11 serial communication interface timing conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?40 to +85 c item symbol min max unit figure input clock cycle t scyc 4 ? t cyc 22.18 input clock cycle (clock sync) t scyc 6 ? t cyc input clock pulse width t sckw 0.4 0.6 t scyc input clock rise time t sckr ? 1.5 t cyc input clock fall time t sckf ? 1.5 t cyc transmit data delay time (clock sync) t txd ? 100 ns 22.19 receive data setup time (clock sync) t rxs 100 ? ns receive data hold time (clock sync) t rxh 100 ? ns
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 671 of 818 rej09b0273-0500 sck0, sck1 t sckw t sckr t sckf t scyc figure 22.18 input clock timing sck0, sck1 txd0, txd1 (transmit data) rxd0, rxd1 (receive data) t scyc t txd t rxs t rxh figure 22.19 sci i/o timing (clock sync mode) 22.3.9 a/d converter timing table 22.12 a/d converter timing conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?40 to +85 c item symbol min max unit figure external trigger input start delay time t trgs 50 ? ns 22.20 a/d conversion time (266 states) t conv ? 266 t cyc 22.21 a/d conversion time (134 states) t conv ? 134
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 672 of 818 rej09b0273-0500 t trgs 1 state ck adcr a dtrg input figure 22.20 external trigger input timing ck address analog input sampling signal adf t conv t d t spl 3 states max. 14 states figure 22.21 analog conversion timing
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 673 of 818 rej09b0273-0500 22.3.10 measuring conditions for ac characteristics ? input reference levels: ? high level: 2.2 v ? low level: 0.8 v ? output reference levels: ? high level: 2.0 v ? low level: 0.8 v c l i oh , i ol i ol | i oh | v ref lsi output pin dut output v note: 30 pf: 50 pf: 70 pf: i ol , i oh : ck, cs0 ? cs3 , breq , back , dack0, dack1, and irqout a21 ? a0, d15 ? d0, rd , wrx port output and peripheral module output pins other than the above. i ol = 1.6 ma, i oh = ? 200 a c l is set with the following pins, including the total capacitance of the measurement jig, etc: figure 22.22 output test circuit
section 22 electrical characteristics rev. 5.00 jan 06, 2006 page 674 of 818 rej09b0273-0500 22.4 a/d converter characteristics table 22.13 a/d converter timing conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?40 to +85 c 20 mhz item min typ max unit resolution 10 10 10 bits conversion time (when cks = 1) ?? 6.7 s analog input capacitance ?? 20 pf permitted signal source impedance ?? 3k ? non-linear error ?? 1.5 lsb offset error ?? 1.5 lsb full-scale error ?? 1.5 lsb quantization error ?? 0.5 lsb absolute error ?? 2.0 lsb
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 675 of 818 rej09b0273-0500 appendix a on-chip supporting module registers a.1 addresses on-chip supporting module register addresses and bit names are shown below. 16-bit and 32-bit registers are shown in two and four rows, respectively. table a.1 two-cycle, 8-bit access space (8-bit and 16-bit access permitted; 32-bit access prohibited) bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff8000 to h'ffff819f ? ????????? h'ffff81a0 smr0 c/ a chr pe o/ e stop mp cks1 cks0 h'ffff81a1 brr0 sci (channel 0) h'ffff81a2 scr0 tie rie te re mpie teie cke1 cke0 h'ffff81a3 tdr0 h'ffff81a4 ssr0 tdre rdrf orer fer per tend mpb mpbt h'ffff81a5 rdr0 h'ffff81a6 to h'ffff81af ? ???????? h'ffff81b0 smr1 c/ a chr pe o/ e stop mp cks1 cks0 h'ffff81b1 brr1 sci (channel 1) h'ffff81b2 scr1 tie rie te re mpie teie cke1 cke0 h'ffff81b3 tdr1 h'ffff81b4 ssr1 tdre rdrf orer fer per tend mpb mpbt h'ffff81b5 rdr1 h'ffff81b6 to h'ffff81bf ? ???????? h'ffff81c0 smr2 c/ a chr pe o/ e stop mp cks1 cks0 h'ffff81c1 brr2 sci (channel 2) h'ffff81c2 scr2 tie rie te re mpie teie cke1 cke0 h'ffff81c3 tdr2 h'ffff81c4 ssr2 tdre rdrf orer fer per tend mpb mpbt h'ffff81c5 rdr2 h'ffff81c6 to h'ffff81ff ? ????????
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 676 of 818 rej09b0273-0500 table a.2 two-cycle, 16-bit access space (in principle, 8-bit, 16-bit, and 32-bit access permitted) bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff8200 tmdr * 1 ?????t5pwmt4pwmt3pwm h'ffff8201? ???????? h'ffff8202 tierdh * 1 ? ? ? ove3 ime3d ime3c ime3b ime3a atu (channels 3?5) h'ffff8203 tsrdh * 1 ???ovf3imf3dimf3cimf3bimf3a h'ffff8204 tierdl * 1 ove4 ime4d ime4c ime4b ime4a ove5 ime5b ime5a h'ffff8205 tsrdl * 1 ovf4 imf4d imf4c imf4b imf4a ovf5 imf5b imf5a h'ffff8206 tcr3 * 2 ? ? ckeg1 ckeg0 ? cksel2 cksel1 cksel0 atu (channel 3) h'ffff8207 tcr4 * 2 ? ? ckeg1 ckeg0 ? cksel2 cksel1 cksel0 atu (channel 4) h'ffff8208 tior3a * 2 cci3b io3b2 io3b1 io3b0 cci3a io3a2 io3a1 io3a0 h'ffff8209 tior3b * 2 cci3d io3d2 io3d1 io3d0 cci3c io3c2 io3c1 io3c0 atu (channel 3) h'ffff820a tior4a * 2 cci4b io4b2 io4b1 io4b0 cci4a io4a2 io4a1 io4a0 h'ffff820b tior4b * 2 cci4d io4d2 io4d1 io4d0 cci4c io4c2 io4c1 io4c0 atu (channel 4) h'ffff820c tcr5 * 2 ? ? ckeg1 ckeg0 ? cksel2 cksel1 cksel0 h'ffff820d tior5a * 2 cci5b io5b2 io5b1 io5b0 cci5a io5a2 io5a1 io5a0 atu (channel 5) h'ffff820e tcnt3 * 3 h'ffff820f atu (channel 3) h'ffff8210 gr3a * 3 h'ffff8211 h'ffff8212 gr3b * 3 h'ffff8213 h'ffff8214 gr3c * 3 h'ffff8215 h'ffff8216 gr3d * 3 h'ffff8217
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 677 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff8218 tcnt4 * 3 h'ffff8219 atu (channel 4) h'ffff821a gr4a * 3 h'ffff821b h'ffff821c gr4b * 3 h'ffff821d h'ffff821e gr4c * 3 h'ffff821f h'ffff8220 gr4d * 3 h'ffff8221 h'ffff8222 tcnt5 * 3 h'ffff8223 atu (channel 5) h'ffff8224 gr5a * 3 h'ffff8225 h'ffff8226 gr5b * 3 h'ffff8227 h'ffff8228 to h'ffff823f ? ????????? h'ffff8240 tiere * 1 ?cme6?cme7?cme8?cme9 h'ffff8241 tsre * 1 ?cmf6?cmf7?cmf8?cmf9 atu (channels 6?9) h'ffff8242 tcr7 * 2 ? ? ? ? ? cksel2 cksel1 cksel0 atu (channel 7) h'ffff8243 tcr6 * 2 ? ? ? ? ? cksel2 cksel1 cksel0 atu (channel 6) h'ffff8244 tcr9 * 2 ? ? ? ? ? cksel2 cksel1 cksel0 atu (channel 9) h'ffff8245 tcr8 * 2 ? ? ? ? ? cksel2 cksel1 cksel0 atu (channel 8)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 678 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff8246 tcnt6 * 3 h'ffff8247 atu (channel 6) h'ffff8248 cylr6 * 3 h'ffff8249 h'ffff824a bfr6 * 3 h'ffff824b h'ffff824c dtr6 * 3 h'ffff824d h'ffff824e tcnt7 * 3 h'ffff824f atu (channel 7) h'ffff8250 cylr7 * 3 h'ffff8251 h'ffff8252 bfr7 * 3 h'ffff8253 h'ffff8254 dtr7 * 3 h'ffff8255 h'ffff8256 tcnt8 * 3 h'ffff8257 atu (channel 8) h'ffff8258 cylr8 * 3 h'ffff8259 h'ffff825a bfr8 * 3 h'ffff825b h'ffff825c dtr8 * 3 h'ffff825d h'ffff825e tcnt9 * 3 h'ffff825f atu (channel 9) h'ffff8260 cylr9 * 3 h'ffff8261 h'ffff8262 bfr9 * 3 h'ffff8263 h'ffff8264 dtr9 * 3 h'ffff8265
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 679 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff8266 to h'ffff827f ? ????????? h'ffff8280 tgsr * 1 ?????trg0d?trg0a h'ffff8281 tior0a * 1 io0d1 io0d0 io0c1 io0c0 io0b1 io0b0 io0a1 io0a0 atu (channel 0) h'ffff8282 itvrr * 1 itvad3 itvad2 itvad1 itvad0 itve3 itve2 itve1 itve0 h'ffff8283 tsrah * 1 ? ? ? ? iif3 iif2 iif1 iif0 h'ffff8284 tiera * 1 ? ? ? ove0 ice0d ice0c ice0b ice0a h'ffff8285 tsral * 1 ???ovf0icf0dicf0cicf0bicf0a h'ffff8286? ???????? h'ffff8287? ???????? h'ffff8288 tcnt0h * 4 h'ffff8289 h'ffff828a tcnt0l * 4 h'ffff828b h'ffff828c icr0ah * 4 h'ffff828d h'ffff828e icr0al * 4 h'ffff828f h'ffff8290 icr0bh * 4 h'ffff8291 h'ffff8292 icr0bl * 4 h'ffff8293 h'ffff8294 icr0ch * 4 h'ffff8295 h'ffff8296 icr0cl * 4 h'ffff8297 h'ffff8298 icr0dh * 4 h'ffff8299 h'ffff829a icr0dl * 4 h'ffff829b h'ffff829c to h'ffff82bf ? ?????????
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 680 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff82c0 tcr1 * 2 ? ? ckeg1 ckeg0 ? cksel2 cksel1 cksel0 h'ffff82c1 tior1a * 2 ? io1b2 io1b1 io1b0 ? io1a2 io1a1 io1a0 atu (channel 1) h'ffff82c2 tior1b * 2 ? io1d2 io1d1 io1d0 ? io1c2 io1c1 io1c0 h'ffff82c3 tior1c * 2 ? io1f2 io1f1 io1f0 ? io1e2 io1e1 io1e0 h'ffff82c4 tierb * 1 ? ove1 ime1f ime1e ime1d ime1c ime1b ime1a h'ffff82c5 tsrb * 1 ? ovf1 imf1f imf1e imf1d imf1c imf1b imf1a h'ffff82c6 tcr2 * 2 ? ? ckeg1 ckeg0 ? cksel2 cksel1 cksel0 h'ffff82c7 tior2a * 2 ? io2b2 io2b1 io2b0 ? io2a2 io2a1 io2a0 atu (channel 2) h'ffff82c8 tierc * 1 ?????ove2ime2bime2a h'ffff82c9 tsrc * 1 ?????ovf2imf2bimf2a h'ffff82ca tcnt2 * 3 h'ffff82cb h'ffff82cc gr2a * 3 h'ffff82cd h'ffff82ce gr2b * 3 h'ffff82cf h'ffff82d0 tcnt1 * 3 h'ffff82d1 atu (channel 1) h'ffff82d2 gr1a * 3 h'ffff82d3 h'ffff82d4 gr1b * 3 h'ffff82d5 h'ffff82d6 gr1c * 3 h'ffff82d7 h'ffff82d8 gr1d * 3 h'ffff82d9 h'ffff82da gr1e * 3 h'ffff82db h'ffff82dc gr1f * 3 h'ffff82dd h'ffff82de osbr * 3 h'ffff82df
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 681 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff82e0 tcr10 * 2 ? cksel2a cksel1a cksel0a ? cksel2b cksel1b cksel0b h'ffff82e1 tcnr * 2 cn10h cn10g cn10f cn10e cn10d cn10c cn10b cn10a h'ffff82e2 tierf * 1 ose10h ose10g ose10f ose10e ose10d ose10c ose10b ose10a atu (channel 10) h'ffff82e3 tsrf * 1 osf10h osf10g osf10f osf10e osf10d osf10c osf10b osf10a h'ffff82e4? ???????? h'ffff82e5 dstr * 1 dst10h dst10g dst10f dst10e dst10d dst10c dst10b dst10a h'ffff82e6? ???????? h'ffff82e7? ???????? h'ffff82e8? ???????? h'ffff82e9 pscr1 * 1 ? ? ? psce pscd pscc pscb psca atu (all channels) h'ffff82ea tstr * 3 ??????str9str8 h'ffff82eb str7 str6 str5 str4 str3 str2 str1 str0 h'ffff82ec to h'ffff82ef ? ????????? h'ffff82f0 dcnt10a * 3 h'ffff82f1 h'ffff82f2 dcnt10b * 3 atu (channel 10) h'ffff82f3 h'ffff82f4 dcnt10c * 3 h'ffff82f5 h'ffff82f6 dcnt10d * 3 h'ffff82f7 h'ffff82f8 dcnt10e * 3 h'ffff82f9 h'ffff82fa dcnt10f * 3 h'ffff82fb h'ffff82fc dcnt10g * 3 h'ffff82fd h'ffff82fe dcnt10h * 3 h'ffff82ff
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 682 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff8300 to h'ffff8347 ? ????????intc h'ffff8348 ipra h'ffff8349 h'ffff834a iprb h'ffff834b h'ffff834c iprc h'ffff834d h'ffff834e iprd h'ffff834f h'ffff8350 ipre h'ffff8351 h'ffff8352 iprf h'ffff8353 h'ffff8354 iprg h'ffff8355 h'ffff8356 iprh h'ffff8357 h'ffff8358icr nmil??????nmie h'ffff8359 irq0s irq1s irq2s irq3s irq4s irq5s irq6s irq7s h'ffff835aisr ???????? h'ffff835b irq0f irq1f irq2f irq3f irq4f irq5f irq6f irq7f h'ffff835c to h'ffff837f ? ???????? h'ffff8380 padr * 2 pa15dr pa14dr pa13dr pa12dr pa11dr pa10dr pa9dr pa8dr port a h'ffff8381 pa7dr pa6dr pa5dr pa4dr pa3dr pa2dr pa1dr pa0dr h'ffff8382 paior * 2 pa15ior pa14ior pa13ior pa12ior pa11ior pa10ior pa9ior pa8ior h'ffff8383 pa7ior pa6ior pa5ior pa4ior pa3ior pa2ior pa1ior pa0ior h'ffff8384 pacr * 2 pa15md pa14md pa13md pa12md pa11md pa10md pa9md pa8md h'ffff8385 pa7md pa6md pa5md pa4md pa3md pa2md pa1md pa0md
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 683 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff8386 pbdr * 2 ? ? pb11dr pb10dr pb9dr pb8dr pb7dr pb6dr port b h'ffff8387 ? ? pb5dr pb4dr pb3dr pb2dr pb1dr pb0dr h'ffff8388 pbior * 2 ? ? pb11ior pb10ior pb9ior pb8ior pb7ior pb6ior h'ffff8389 ? ? pb5ior pb4ior pb3ior pb2ior pb1ior pb0ior h'ffff838a pbcr * 2 ? pb11md 1 pb11md 0 pb10md pb9md pb8md pb7md pb6md h'ffff838b ? ? pb5md pb4md pb3md pb2md pb1md pb0md h'ffff838c to h'ffff838f ? ????????? h'ffff8390 pcdr * 2 ? pc14dr pc13dr pc12dr pc11dr pc10dr pc9dr pc8dr port c h'ffff8391 pc7dr pc6dr pc5dr pc4dr pc3dr pc2dr pc1dr pc0dr h'ffff8392 pcior * 2 ? pc14ior pc13ior pc12ior pc11ior pc10ior pc9ior pc8ior h'ffff8393 pc7ior pc6ior pc5ior pc4ior pc3ior pc2ior pc1ior pc0ior h'ffff8394 pccr1 * 2 ?? pc14md1 pc14md0 pc13md1 pc13md0 pc12md1 pc12md0 h'ffff8395 pc11md1 pc11md0 pc10md1 pc10md0 pc9md1 pc9md0 pc8md1 pc8md0 h'ffff8396 pccr2 * 2 pc7md1 pc7md0 pc6md1 pc6md0 ? pc5md ? pc4md h'ffff8397 ? pc3md ? pc2md ? pc1md ? pc0md h'ffff8398 pddr * 2 pd15dr pd14dr pd13dr pd12dr pd11dr pd10dr pd9dr pd8dr port d h'ffff8399 pd7dr pd6dr pd5dr pd4dr pd3dr pd2dr pd1dr pd0dr h'ffff839a pdior * 2 pd15ior pd14ior pd13ior pd12ior pd11ior pd10ior pd9ior pd8ior h'ffff839b pd7ior pd6ior pd5ior pd4ior pd3ior pd2ior pd1ior pd0ior h'ffff839c pdcr * 2 pd15md pd14md pd13md pd12md pd11md pd10md pd9md pd8md h'ffff839d pd7md pd6md pd5md pd4md pd3md pd2md pd1md pd0md h'ffff839eckcr????????port h'ffff839f ???????cklo h'ffff83a0 pedr * 2 ? pe14dr pe13dr pe12dr pe11dr pe10dr pe9dr pe8dr port e h'ffff83a1 pe7dr pe6dr pe5dr pe4dr pe3dr pe2dr pe1dr pe0dr h'ffff83a2 peior * 2 ? pe14ior pe13ior pe12ior pe11ior pe10ior pe9ior pe8ior h'ffff83a3 pe7ior pe6ior pe5ior pe4ior pe3ior pe2ior pe1ior pe0ior h'ffff83a4 pecr * 2 ? pe14md pe13md pe12md pe11md pe10md pe9md pe8md h'ffff83a5 pe7md pe6md pe5md pe4md pe3md pe2md pe1md pe0md
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 684 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff83a6 pfdr * 2 ? ? ? ? pf11dr pf10dr pf9dr pf8dr port f h'ffff83a7 pf7dr pf6dr pf5dr pf4dr pf3dr pf2dr pf1dr pf0dr h'ffff83a8 pfior * 2 ? ? ? ? pf11ior pf10ior pf9ior pf8ior h'ffff83a9 pf7ior pf6ior pf5ior pf4ior pf3ior pf2ior pf1ior pf0ior h'ffff83aa pfcr1 * 2 ???????? h'ffff83ab pf11md1 pf11md0 pf10md1 pf10md0 pf9md1 pf9md0 pf8md1 pf8md0 h'ffff83ac pfcr2 * 2 pf7md1 pf7md0 pf6md1 pf6md0 pf5md1 pf5md0 pf4md1 pf4md0 h'ffff83ad ?pf3md?pf2md?pf1md?pf0md h'ffff83ae pgdr * 2 pg15dr pg14dr pg13dr pg12dr pg11dr pg10dr pg9dr pg8dr port g h'ffff83af pg7dr pg6dr pg5dr pg4dr pg3dr pg2dr pg1dr pg0dr h'ffff83b0 pgior * 2 pg15ior pg14ior pg13ior pg12ior pg11ior pg10ior pg9ior pg8ior h'ffff83b1 pg7ior pg6ior pg5ior pg4ior pg3ior pg2ior pg1ior pg0ior h'ffff83b2 pgcr1 * 2 pg15md1 pg15md0 pg14md1 pg14md0 ?pg13md?pg12md h'ffff83b3 ?pg11md?pg10md?pg9md?pg8md h'ffff83b4 pgcr2 * 2 ?pg7md?pg6md?pg5md?pg4md h'ffff83b5 ? pg3md pg2md pg1md pg0md1 pg0md0 irqmd1 irqmd0 h'ffff83b6 phdr * 2 ph15dr ph14dr ph13dr ph12dr ph11dr ph10dr ph9dr ph8dr port h h'ffff83b7 ph7dr ph6dr ph5dr ph4dr ph3dr ph2dr ph1dr ph0dr h'ffff83b8 adtrgr * 1 extrg???????ad0 h'ffff83b9 to h'ffff83bf ? ????????? h'ffff83c0 popcr * 2 pulse7roe pulse6roe pulse5roe pulse4roe pulse3roe pulse2roe pulse1roe pulse0roe apc h'ffff83c1 pulse7soe pulse6soe pulse5soe pulse4soe pulse3soe pulse2soe pulse1soe pulse0soe h'ffff83c2 to h'ffff83c7 ? ????????? h'ffff83c8 syscr * 1 ???????rame(power- down state) h'ffff83c9 to h'ffff83cf ? ?????????
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 685 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff83d0 cmstr ? ? ? ? ? ? ? ? h'ffff83d1 ? ? ? ? ? ? str1 str0 cmt (both channels) h'ffff83d2 cmcsr0 ? ? ? ? ? ? ? ? h'ffff83d3 cmf cmie ? ? ? ? cks1 cks0 cmt (channel 0) h'ffff83d4 cmcnt0 h'ffff83d5 h'ffff83d6 cmcor0 h'ffff83d7 h'ffff83d8 cmcsr1 ? ? ? ? ? ? ? ? h'ffff83d9 cmf cmie ? ? ? ? cks1 cks0 cmt (channel 1) h'ffff83da cmcnt1 h'ffff83db h'ffff83dc cmcor1 h'ffff83dd h'ffff83de to h'ffff83ff ? ????????? notes: 1. only 8-bit access permitted; 16-bit and 32-bit access prohibited. 2. 8-bit and 16-bit access permitted; 32-bit access prohibited. 3. only 16-bit access permitted; 8-bit and 32-bit access prohibited. 4. only 32-bit access permitted; 8-bit and 16-bit access prohibited
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 686 of 818 rej09b0273-0500 table a.3 three-cycle, 8-bit access space (8-bit and 16-bit access permitted; 32-bit access prohibited) bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff8400 to h'ffff857f ? ????????? h'ffff8580 flmcr1 * fwe vppe esu psu ev pv e p flash h'ffff8581 flmcr2 * fler??????? h'ffff8582 ebr1 * eb7 eb6 eb5 eb4 eb3 eb2 eb1 eb0 h'ffff8583 to h'ffff85cf ? ????????? h'ffff85d0 addr0h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 ad0 h'ffff85d1 addr0l ad1 ad0 ? ? ? ? ? ? h'ffff85d2 addr1h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85d3 addr1l ad1 ad0 ? ? ? ? ? ? h'ffff85d4 addr2h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85d5 addr2l ad1 ad0 ? ? ? ? ? ? h'ffff85d6 addr3h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85d7 addr3l ad1 ad0 ? ? ? ? ? ? h'ffff85d8 addr4h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85d9 addr4l ad1 ad0 ? ? ? ? ? ? h'ffff85da addr5h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85db addr5l ad1 ad0 ? ? ? ? ? ? h'ffff85dc addr6h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85dd addr6l ad1 ad0 ? ? ? ? ? ? h'ffff85de addr7h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85df addr7l ad1 ad0 ? ? ? ? ? ? h'ffff85e0 addr8h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85e1 addr8l ad1 ad0 ? ? ? ? ? ? h'ffff85e2 addr9h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85e3 addr9l ad1 ad0 ? ? ? ? ? ? h'ffff85e4 addr10h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85e5 addr10l ad1 ad0 ? ? ? ? ? ? h'ffff85e6 addr11h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85e7 addr11l ad1 ad0 ? ? ? ? ? ? h'ffff85e8 adcsr0 adf adie adm1 adm0 ch3 ch2 ch1 ch0 h'ffff85e9 adcr0 trge cks adst ? ? ? ? ?
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 687 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff85ea to h'ffff85ef ? ????????? h'ffff85f0 addr12h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 ad1 h'ffff85f1 addr12l ad1 ad0 ? ? ? ? ? ? h'ffff85f2 addr13h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85f3 addr13l ad1 ad0 ? ? ? ? ? ? h'ffff85f4 addr14h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85f5 addr14l ad1 ad0 ? ? ? ? ? ? h'ffff85f6 addr15h ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'ffff85f7 addr15l ad1 ad0 ? ? ? ? ? ? h'ffff85f8 adcsr1 adf adie adst scan cks ? ch1 ch0 h'ffff85f9 adcr1 trge ? ? ? ? ? ? ? h'ffff85fa to h'ffff85ff ? ????????? note: * only 8-bit access permitted; 16-bit and 32-bit access prohibited.
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 688 of 818 rej09b0273-0500 table a.4 three-cycle, 16-bit access space (in principle, 8-bit, 16-bit, and 32-bit access permitted) bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff8600 ubarh uba31 uba30 uba29 uba28 uba27 uba26 uba25 uba24 ubc h'ffff8601 uba23 uba22 uba21 uba20 uba19 uba18 uba17 uba16 h'ffff8602 ubarl uba15 uba14 uba13 uba12 uba11 uba10 uba9 uba8 h'ffff8603 uba7 uba6 uba5 uba4 uba3 uba2 uba1 uba0 h'ffff8604 ubamrh ubm31 ubm30 ubm29 ubm28 ubm27 ubm26 ubm25 ubm24 h'ffff8605 ubm23 ubm22 ubm21 ubm20 ubm19 ubm18 ubm17 ubm16 h'ffff8606 ubamrl ubm15 ubm14 ubm13 ubm12 ubm11 ubm10 ubm9 ubm8 h'ffff8607 ubm7 ubm6 ubm5 ubm4 ubm3 ubm2 ubm1 ubm0 h'ffff8608ubbr???????? h'ffff8609 cp1 cp0 id1 id0 rw1 rw0 sz1 sz0 h'ffff860a to h'ffff860f ? ????????? h'ffff8610 tcsr * 4 ovf wt/ it tme ? ? cks2 cks1 cks0 wdt h'ffff8611 tcnt * 4 h'ffff8612? ???????? h'ffff8613 rstcsr * 4 wovfrste?????? h'ffff8614 sbycr * 1 ssby hiz ? ? ? ? ? ? (power- down state) h'ffff8615 to h'ffff861f ? ????????? h'ffff8620bcr1????????bsc h'ffff8621 ? ? ? ? a3sz a2sz a1sz a0sz h'ffff8622 bcr2 iw31 iw30 iw21 iw20 iw11 iw10 iw01 iw00 h'ffff8623 cw3 cw2 cw1 cw0 sw3 sw2 sw1 sw0 h'ffff8624 wcr1 w33 w32 w31 w30 w23 w22 w21 w20 h'ffff8625 w13 w12 w11 w10 w03 w02 w01 w00 h'ffff8626wcr2???????? h'ffff8627 ? ? ? ? dsw3 dsw2 dsw1 dsw0
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 689 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff8628ramer????????flash h'ffff8629 ?????ramsram1ram0 h'ffff862a to h'ffff86af ? ????????? h'ffff86b0 dmaor * 2 ??????pr1pr0 h'ffff86b1 ?????aenmifdme dmac (all channels) h'ffff86b2 to h'ffff86bf ? ????????? h'ffff86c0 sar0 * 5 h'ffff86c1 dmac (channel 0) h'ffff86c2 h'ffff86c3 h'ffff86c4 dar0 * 5 h'ffff86c5 h'ffff86c6 h'ffff86c7 h'ffff86c8 dmatcr0 * 3 ???????? h'ffff86c9 h'ffff86ca h'ffff86cb h'ffff86cc chcr0 * 5 ???????? h'ffff86cd ?????rlamal h'ffff86ce dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 h'ffff86cf ? ds tm ts1 ts0 ie te de
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 690 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff86d0 sar1 * 5 h'ffff86d1 dmac (channel 1) h'ffff86d2 h'ffff86d3 h'ffff86d4 dar1 * 5 h'ffff86d5 h'ffff86d6 h'ffff86d7 h'ffff86d8 dmatcr1 * 3 ???????? h'ffff86d9 h'ffff86da h'ffff86db h'ffff86dc chcr1 * 5 ???????? h'ffff86dd ?????rlamal h'ffff86de dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 h'ffff86df ? ds tm ts1 ts0 ie te de h'ffff86e0 sar2 * 5 h'ffff86e1 dmac (channel 2) h'ffff86e2 h'ffff86e3 h'ffff86e4 dar2 * 5 h'ffff86e5 h'ffff86e6 h'ffff86e7 h'ffff86e8 dmatcr2 * 3 ???????? h'ffff86e9 h'ffff86ea h'ffff86eb h'ffff86ec chcr2 * 5 ???????? h'ffff86ed ? ? ? ? ro ? ? ? h'ffff86ee dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 h'ffff86ef ? ? tm ts1 ts0 ie te de
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 691 of 818 rej09b0273-0500 bit names address register abbr. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 module h'ffff86f0 sar3 * 5 h'ffff86f1 dmac (channel 3) h'ffff86f2 h'ffff86f3 h'ffff86f4 dar3 * 5 h'ffff86f5 h'ffff86f6 h'ffff86f7 h'ffff86f8 dmatcr3 * 3 ???????? h'ffff86f9 h'ffff86fa h'ffff86fb h'ffff86fc chcr3 * 5 ???????? h'ffff86fd ? ? ? di ? ? ? ? h'ffff86fe dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 h'ffff86ff ? ? tm ts1 ts0 ie te de h'ffff8700 to h'ffff87ff ? ????????? notes: 1. only 8-bit access permitted; 16-bit and 32-bit access prohibited. 2. only 16-bit access permitted; 8-bit and 32-bit access prohibited. 3. only 32-bit access permitted; 8-bit and 16-bit access prohibited. 4. this is the read address. the write address is h'ffff8610 for the tcsr and tcnt, and h'ffff8612 for rstcsr. for details, see 12.2.4, register access, in section 12, watchdog timer. 5. 16-bit and 32-bit access permitted; 8-bit access prohibited.
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 692 of 818 rej09b0273-0500 a.2 registers serial mode register (smr) bit no. initial value type of access permitted abbreviation of register name register name h'ffff81a0 (channel 0) 8/16 address onto which register is mapped sci name of on-chip supporting module bit names (abbreviations). bits marked ??? are reserved. full name of bit description of bit function bit: bit name: initial value: r/w: 7 c/ a 0 r/w 6 chr 0 r/w 5 pe 0 r/w 4 o/ e 0 r/w 3 stop 0 r/w 0 cks0 0 r/w 2 mp 0 r/w 1 cks1 0 r/w access size bit bit name value description 7 communication mode (c/a) 0 asynchronous mode (initial value) 1 synchronous mode 6 character length (chr) 0 8-bit data (initial value) 1 7-bit data 5 parity enable (pe) 0 parity bit addition and check disabled (initial value) 1 parity bit addition and check enabled 4 parity mode (o/e) 0 even parity (initial value) 1 odd parity 3 stop bit length (stop) 0 1 stop bit (initial value) 1 2 stop bits 2 multiprocessor bit (mp) 0 multiprocessor function disabled (initial value) 1 multiprocessor format selected 1, 0 clock select 1, 0 0 0 clock (initial value) (cks1, cks0) 1 /4 clock 1 0 /16 clock 1 /64 clock read only write only read or write r w r/w
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 693 of 818 rej09b0273-0500 serial mode register (smr) h'ffff81a0 (channel 0) h'ffff81b0 (channel 1) h'ffff81c0 (channel 2) 8/16 sci bit:76543210 bit name: c/ a chr pe o/ e stop mp cks1 cks0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7 communication mode (c/ a ) 0 asynchronous mode (initial value) 1 synchronous mode 6 character length (chr) 0 8-bit data (initial value) 1 7-bit data 5 parity enable (pe) 0 parity bit addition and check disabled (initial value) 1 parity bit addition and check enabled 4 parity mode (o/ e ) 0 even parity (initial value) 1 odd parity 3 stop bit length (stop) 0 1 stop bit (initial value) 1 2 stop bits 2 multiprocessor bit (mp) 0 multiprocessor function disabled (initial value) 1 multiprocessor format selected 1, 0 clock select 1, 0 0 0 clock (initial value) (cks1, cks0) 1 /4 clock 10 /16 clock 1 /64 clock
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 694 of 818 rej09b0273-0500 bit rate register (brr) h'ffff81a1 (channel 0) h'ffff81b1 (channel 1) h'ffff81c1 (channel 2) 8/16 sci bit:76543210 bit name: initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 7 ? 0 (bit mode setting) serial transmit/receive bit rate setting
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 695 of 818 rej09b0273-0500 serial control register (scr) h'ffff81a2 (channel 0) h'ffff81b2 (channel 1) h'ffff81c2 (channel 2) 8/16 sci bit:76543210 bit name: tie rie te re mpie teie cke1 cke0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7 0 transmit-data-empty interrupt request (txi) is disabled (initial value) transmit interrupt enable (tie) 1 transmit-data-empty interrupt request (txi) is enabled 6 receive interrupt enable (rie) 0 receive-data-full (rxi) and receive-error (eri) interrupt requests are disabled (initial value) 1 receive-data-full (rxi) and receive-error (eri) interrupt requests are enabled 5 transmit enable (te) 0 transmitting is disabled (initial value) 1 transmitting is enabled 4 receive enable (re) 0 receiving is disabled (initial value) 1 receiving is enabled 3 multiprocessor interrupt enable (mpie) 0 multiprocessor interrupts are disabled (normal receive operation) (initial value) [clearing conditions] 1. clearing mpie to 0 2. when data with mpb = 1 is received 1 multiprocessor interrupts are enabled receive data full interrupt (rxi) and receive error interrupt (eri) requests, and setting of rdrf, fer, and orer flags in ssr, are disabled until data with the multiprocessor bit set to 1 is received. 2 0 transmit-end interrupt requests (tei) are disabled (initial value) transmit-end interrupt enable (teie) 1 transmit-end interrupt requests (tei) are enabled 1, 0 clock enable 1 and 0 (cke1, cke0) 0 0 asynchronous mode internal clock, sck pin used as input pin (input signal ignored) or output pin (output level undefined) synchronous mode internal clock, sck pin used for serial clock output 1 asynchronous mode internal clock, sck pin used for clock output synchronous mode internal clock, sck pin used for serial clock output 1 0 asynchronous mode external clock, sck pin used for clock input synchronous mode external clock, sck pin used for serial clock input 1 asynchronous mode external clock, sck pin used for clock input synchronous mode external clock, sck pin used for serial clock input
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 696 of 818 rej09b0273-0500 transmit data register (tdr) h'ffff81a3 (channel 0) h'ffff81b3 (channel 1) h'ffff81c3 (channel 2) 8/16 sci bit:76543210 bit name: initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 7 ? 0 (transmit data storage) serial transmit data
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 697 of 818 rej09b0273-0500 serial status register (ssr) h'ffff81a4 (channel 0) h'ffff81b4 (channel 1) h'ffff81c4 (channel 2) 8/16 sci bit:76543210 bit name: tdre rdrf orer fer per tend mpb mpbt initial value:10000100 r/w: r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * rrr/w note: * only 0 can be written to clear the flag. bit bit name value description 7 transmit data register empty (tdre) 0 valid transmit data has been written in tdr. [clearing conditions] 1. read tdre when tdre = 1, then write 0 in tdre 2. the dmac writes data in tdr 1 there is no valid transmit data in tdr (initial value) [setting conditions] 1. power-on reset, or transition to hardware standby mode or software standby mode 2. te is cleared to 0 in scr 3. data is transferred from tdr to tsr, enabling new data to be written in tdr 6 receive data register full (rdrf) 0 there is no valid receive data in rdr (initial value) [clearing conditions] 1. power-on reset, or transition to hardware standby mode or software standby mode 2. read rdrf when rdrf = 1, then write 0 in rdrf 3. the dmac reads data from rdr 1 there is valid receive data in rdr [setting condition] serial data is received normally and transferred from rsr to rdr 5 overrun error (orer) 0 receiving in progress, or completed normally (initial value) [clearing conditions] 1. power-on reset, or transition to hardware standby mode or software standby mode 2. read orer when orer = 1, then write 0 in orer 1 overrun error occurred during reception [setting condition] overrun error (reception of next serial data ends while rdrf = 1)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 698 of 818 rej09b0273-0500 bit bit name value description 4 framing error (fer) 0 receiving in progress, or completed normally (initial value) [clearing conditions] 1. power-on reset, or transition to hardware standby mode or software standby mode 2. read fer when fer = 1, then write 0 in fer 1 framing error occurred during reception [setting condition] framing error (stop bit is 0) 3 parity error (per) 0 receiving in progress, or completed normally (initial value) [clearing conditions] 1. power-on reset, or transition to hardware standby mode or software standby mode 2. read per when per = 1, then write 0 in per 1 parity error occurred during reception [setting condition] parity error (parity of receive data does not match parity setting of o/ e bit in smr) 2 transmit end (tend) 0 transmitting in progress [clearing conditions] 1. read tdre when tdre = 1, then write 0 in tdre 2. the dmac writes data in tdr 1 transmitting has ended (initial value) [setting conditions] 1. power-on reset, or transition to hardware standby mode or software standby mode 2. te is cleared to 0 in scr 3. tdre = 1 when last bit of 1-byte serial transmit character is transmitted 1 0 multiprocessor bit value in receive data is 0 (initial value) multiprocessor bit (mpb) 1 multiprocessor bit value in receive data is 1 0 0 multiprocessor bit value in transmit data is 0 (initial value) multiprocessor bit transfer (mpbt) 1 multiprocessor bit value in transmit data is 1
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 699 of 818 rej09b0273-0500 receive data register (rdr) h'ffff81a5 (channel 0) h'ffff81b5 (channel 1) h'ffff81c5 (channel 2) 8/16 sci bit:76543210 bit name: initial value:00000000 r/w:rrrrrrrr bit bit name description 7 ? 0 (receive data storage) serial receive data
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 700 of 818 rej09b0273-0500 timer mode register (tmdr) h'ffff8200 (channels 3 to 5) 8atu bit:76543210 bit name: ????? t5pwm t4pwm t3pwm initial value:00000000 r/w:rrrrrr/wr/wr/w bit bit name value description 2 pwm mode 5 (t5pwm) 0 channel 5 is in input capture/output compare mode (initial value) 1 channel 5 is in pwm mode 1 pwm mode 4 (t4pwm) 0 channel 4 is in input capture/output compare mode (initial value) 1 channel 4 is in pwm mode 0 pwm mode 3 (t3pwm) 0 channel 3 is in input capture/output compare mode (initial value) 1 channel 3 is in pwm mode
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 701 of 818 rej09b0273-0500 timer interrupt enable register dh (tierdh) h'ffff8202 (channels 3 to 5) 8atu bit:76543210 bit name: ??? ove3 ime3d ime3c ime3b ime3a initial value:00000000 r/w: r r r r/w r/w r/w r/w r/w bit bit name value description 4 overflow interrupt enable (ove3) 0 ovi3 interrupt requested by ovf3 flag is disabled (initial value) 1 ovi3 interrupt requested by ovf3 flag is enabled 3 0 imi3d interrupt requested by imf3d flag is disabled (initial value) input capture/compare match interrupt enable (ime3d) 1 imi3d interrupt requested by imf3d flag is enabled 2 0 imi3c interrupt requested by imf3c flag is disabled (initial value) input capture/compare match interrupt enable (ime3c) 1 imi3c interrupt requested by imf3c flag is enabled 1 0 imi3b interrupt requested by imf3b flag is disabled (initial value) input capture/compare match interrupt enable (ime3b) 1 imi3b interrupt requested by imf3b flag is enabled 0 0 imi3a interrupt requested by imf3a flag is disabled (initial value) input capture/compare match interrupt enable (ime3a) 1 imi3a interrupt requested by imf3a flag is enabled
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 702 of 818 rej09b0273-0500 timer status register dh (tsrdh) h'ffff8203 (channels 3 to 5) 8atu bit:76543210 bit name: ??? ovf3 imf3d imf3c imf3b imf3a initial value:00000000 r/w: r r r r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * only 0 can be written to clear the flag. bit bit name value description 4overflow flag (ovf3) 0 [clearing condition] (initial value) read ovf3 when ovf3 =1, then write 0 in ovf3 1 [setting condition] tcnt3 overflowed from h'ffff to h'0000 30 [clearing condition] (initial value) read imf3d when imf3d =1, then write 0 in imf3d input capture/ compare match flag (imf3d) 1 [setting conditions] 1. tcnt3 value is transferred to gr3d by an input capture signal when gr3d functions as an input capture register 2. tcnt3 = gr3d when gr3d functions as an output compare register 2 0 [clearing condition] (initial value) read imf3c when imf3c =1, then write 0 in imf3c input capture/ compare match flag (imf3c) 1 [setting conditions] 1. tcnt3 value is transferred to gr3c by an input capture signal when gr3c functions as an input capture register 2. tcnt3 = gr3c when gr3c functions as an output compare register 1 0 [clearing condition] (initial value) read imf3b when imf3b =1, then write 0 in imf3b input capture/ compare match flag (imf3b) 1 [setting conditions] 1. tcnt3 value is transferred to gr3b by an input capture signal when gr3b functions as an input capture register 2. tcnt3 = gr3b when gr3b functions as an output compare register 0 0 [clearing condition] (initial value) read imf3a when imf3a =1, then write 0 in imf3a input capture/ compare match flag (imf3a) 1 [setting conditions] 1. tcnt3 value is transferred to gr3a by an input capture signal when gr3a functions as an input capture register 2. tcnt3 = gr3a when gr3a functions as an output compare register
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 703 of 818 rej09b0273-0500 timer interrupt enable register dl (tierdl) h'ffff8204 (channels 3 to 5) 8atu bit:76543210 bit name: ove4 ime4d ime4c ime4b ime4a ove5 ime5b ime5a initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7 overflow interrupt enable (ove4) 0 ovi4 interrupt requested by ovf4 flag is disabled (initial value) 1 ovi4 interrupt requested by ovf4 flag is enabled 6 0 imi4d interrupt requested by imf4d flag is disabled (initial value) input capture/compare match interrupt enable (ime4d) 1 imi4d interrupt requested by imf4d flag is enabled 5 0 imi4c interrupt requested by imf4c flag is disabled (initial value) input capture/compare match interrupt enable (ime4c) 1 imi4c interrupt requested by imf4c flag is enabled 4 0 imi4b interrupt requested by imf4b flag is disabled (initial value) input capture/compare match interrupt enable (ime4b) 1 imi4b interrupt requested by imf4b flag is enabled 3 0 imi4a interrupt requested by imf4a flag is disabled (initial value) input capture/compare match interrupt enable (ime4a) 1 imi4a interrupt requested by imf4a flag is enabled 2 overflow interrupt enable (ove5) 0 ovi5 interrupt requested by ovf5 flag is disabled (initial value) 1 ovi5 interrupt requested by ovf5 flag is enabled 1 0 imi5b interrupt requested by imf5b flag is disabled (initial value) input capture/compare match interrupt enable (ime5b) 1 imi5b interrupt requested by imf5b flag is enabled 0 0 imi5a interrupt requested by imf5a flag is disabled (initial value) input capture/compare match interrupt enable (ime5a) 1 imi5a interrupt requested by imf5a flag is enabled
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 704 of 818 rej09b0273-0500 timer status register dl (tsrdl) h'ffff8205 (channels 3 to 5) 8atu bit:76543210 bit name: ovf4 imf4d imf4c imf4b imf4a ovf5 imf5b imf5a initial value:00000000 r/w: r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * only 0 can be written to clear the flag. bit bit name value description 7overflow flag (ovf4) 0 [clearing condition] (initial value) read ovf4 when ovf4 =1, then write 0 in ovf4 1 [setting condition] tcnt4 overflowed from h'ffff to h'0000 6 0 [clearing condition] (initial value) read imf4d when imf4d =1, then write 0 in imf4d input capture/ compare match flag (imf4d) 1 [setting conditions] 1. tcnt4 value is transferred to gr4d by an input capture signal when gr4d functions as an input capture register 2. tcnt4 = gr4d when gr4d functions as an output compare register 5 0 [clearing condition] (initial value) read imf4c when imf4c =1, then write 0 in imf4c input capture/ compare match flag (imf4c) 1 [setting conditions] 1. tcnt4 value is transferred to gr4c by an input capture signal when gr4c functions as an input capture register 2. tcnt4 = gr4c when gr4c functions as an output compare register 4 0 [clearing condition] (initial value) read imf4b when imf4b =1, then write 0 in imf4b input capture/ compare match flag (imf4b) 1 [setting conditions] 1. tcnt4 value is transferred to gr4b by an input capture signal when gr4b functions as an input capture register 2. tcnt4 = gr4b when gr4b functions as an output compare register
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 705 of 818 rej09b0273-0500 bit bit name value description 3 0 [clearing condition] (initial value) read imf4a when imf4a =1, then write 0 in imf4a input capture/ compare match flag (imf4a) 1 [setting conditions] 1. tcnt4 value is transferred to gr4a by an input capture signal when gr4a functions as an input capture register 2. tcnt4 = gr4a when gr4a functions as an output compare register 2overflow flag (ovf5) 0 [clearing condition] (initial value) read ovf5 when ovf5 =1, then write 0 in ovf5 1 [setting condition] tcnt5 overflowed from h'ffff to h'0000 1 0 [clearing condition] (initial value) read imf5b when imf5b =1, then write 0 in imf5b input capture/ compare match flag (imf5b) 1 [setting conditions] 1. tcnt5 value is transferred to gr5b by an input capture signal when gr5b functions as an input capture register 2. tcnt5 = gr5b when gr5b functions as an output compare register 0 0 [clearing condition] (initial value) read imf5a when imf5a =1, then write 0 in imf5a input capture/ compare match flag (imf5a) 1 [setting conditions] 1. tcnt5 value is transferred to gr5a by an input capture signal when gr5a functions as an input capture register 2. tcnt5 = gr5a when gr5a functions as an output compare register
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 706 of 818 rej09b0273-0500 h'ffff82c0 (channel 1) 8/16 atu timer control registers 1 to 5 (tcr1 to tcr5) h'ffff82c6 (channel 2) 8/16 h'ffff8206 (channel 3) 8/16 h'ffff8207 (channel 4) 8/16 h'ffff820c (channel 5) 8/16 bit:76543210 bit name: ?? ckeg1 ckeg0 ? cksel2 cksel1 cksel0 initial value:00000000 r/w: r r r/w r/w r r/w r/w r/w bit bit name value description 5, 4 0 0 rising edges counted (initial value) clock edge 1 and 0 (ckeg1, ckeg0) 1 falling edges counted 1 0 both edges counted 1 external clock counting disabled 2, 1, 0 0 0 0 internal clock ": counting on ' (initial value) clock select 2 to 0 (cksel2 to cksel0) 1 internal clock ": counting on '/2 1 0 internal clock ": counting on '/4 1 internal clock ": counting on '/8 1 0 0 internal clock ": counting on '/16 1 internal clock ": counting on '/32 1 0 external clock: counting on tclka input 1 external clock: counting on tclkb input
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 707 of 818 rej09b0273-0500 h'ffff8208 (channel 3, 3a) 8/16 atu h'ffff8209 (channel 3, 3b) 8/16 h'ffff820a (channel 4, 4a) 8/16 timer i/o control registers 3a, 3b, 4a, 4b, 5a (tior3a, tiora3b, tior4a, tior4b, tior5a) h'ffff820b (channel 4, 4b) 8/16 h'ffff820d (channel 5, 5a) 8/16 tior3a bit:76543210 bit name: cci3b io3b2 io3b1 io3b0 cci3a io3a2 io3a1 io3a0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w tior3b bit:76543210 bit name: cci3d io3d2 io3d1 io3d0 cci3c io3c2 io3c1 io3c0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w tior4a bit:76543210 bit name: cci4b io4b2 io4b1 io4b0 cci4a io4a2 io4a1 io4a0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w tior4b bit:76543210 bit name: cci4d io4d2 io4d1 io4d0 cci4c io4c2 io4c1 io4c0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w tior5a bit:76543210 bit name: cci5b io5b2 io5b1 io5b0 cci5a io5a2 io5a1 io5a0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 708 of 818 rej09b0273-0500 bit bit name value description 7 0 tcnt clearing disabled (initial value) clear counter enable flags 3b, 3d, 4b, 4d, 5b (cci3b, cci3d, cci4b, cci4d, cci5b) 1 tcnt cleared by gr compare match 6, 5, 4 0 0 0 0 output regardless of compare match (initial value) 1 0 output at gr compare match 10 gr is output compare register 1 output at gr compare match i/o control 3b2 ? 3b0, 3d2 ? 3d0, 4b2 ? 4b0, 4d2 ? 4d0, 5b2 ? 5b0 (io3b2 ? io3b0, io3d2 ? io3d0, io4b2 ? io4b0, io4d2 ? io4d0, io5b2 ? io5b0) 1 output toggles at gr compare match 1 0 0 input capture disabled 1 input capture to gr at rising edge 10 gr is input capture register input capture to gr at falling edge 1 input capture to gr at both edges 3 0 tcnt clearing disabled (initial value) clear counter enable flags 3a, 3c, 4a, 4c, 5a (cci3a, cci3c, cci4a, cci4c, cci5a) 1 tcnt cleared by gr compare match 2, 1, 0 0 0 0 0 output regardless of compare match (initial value) 1 0 output at gr compare match 1 0 1 output at gr compare match i/o control 3a2 ? 3a0, 3c2 ? 3c0, 4a2 ? 4a0, 4c2 ? 4c0, 5a2 ? 5a0 (io3a2 ? io3a0, io3c2 ? io3c0, io4a2 ? io4a0, io4c2 ? io4c0, io5a2 ? io5a0) 1 gr is output compare register output toggles at gr compare match 1 0 0 input capture disabled 1 input capture to gr at rising edge 10 gr is input capture register input capture to gr at falling edge 1 input capture to gr at both edges
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 709 of 818 rej09b0273-0500 h'ffff82d0 (channel 1) 16 atu free-running counters 1 to 5 (tcnt1 to tcnt5) h'ffff82ca (channel 2) 16 h'ffff820e (channel 3) 16 h'ffff8218 (channel 4) 16 h'ffff8222 (channel 5) 16 bit:1514131211109876543210 bit name: initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 (16-bit up-counter, initial value h'0000) counts input clock pulses h'ffff8210 (channel 3, 3a) 16 atu h'ffff8212 (channel 3, 3b) 16 h'ffff8214 (channel 3, 3c) 16 general registers 3a to 3d, 4a to 4d, 5a, 5b (gr3a to gr3d, gr4a to gr4d, gr5a, gr5b) h'ffff8216 (channel 3, 3d) 16 h'ffff821a (channel 4, 4a) 16 h'ffff821c (channel 4, 4b) 16 h'ffff821e (channel 4, 4c) 16 h'ffff8220 (channel 4, 4d) 16 h'ffff8224 (channel 5, 5a) 16 h'ffff8226 (channel 5, 5b) 16 bit:1514131211109876543210 bit name: initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 (dual-function input capture/output compare register) 1. input capture register: stores tcnt1 value when input capture signal is generated 2. output compare register: set with compare match value
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 710 of 818 rej09b0273-0500 timer interrupt enable register e (tiere) h'ffff8240 (channels 6 to 9) 8atu bit:76543210 bit name: ? cme6 ? cme7 ? cme8 ? cme9 initial value:00000000 r/w:rr/wrr/wrr/wrr/w bit bit name value description 6 0 cmi6 interrupt requested by cmf6 flag is disabled (initial value) cycle register compare match interrupt enable (cme6) 1 cmi6 interrupt requested by cmf6 flag is enabled 4 0 cmi7 interrupt requested by cmf7 flag is disabled (initial value) cycle register compare match interrupt enable (cme7) 1 cmi7 interrupt requested by cmf7 flag is enabled 2 0 cmi8 interrupt requested by cmf8 flag is disabled (initial value) cycle register compare match interrupt enable (cme8) 1 cmi8 interrupt requested by cmf8 flag is enabled 0 0 cmi9 interrupt requested by cmf9 flag is disabled (initial value) cycle register compare match interrupt enable (cme9) 1 cmi9 interrupt requested by cmf9 flag is enabled
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 711 of 818 rej09b0273-0500 timer status register e (tsre) h'ffff8241 (channels 6 to 9) 8atu bit:76543210 bit name: ? cmf6 ? cmf7 ? cmf8 ? cmf9 initial value:00000000 r/w: r r/(w) * rr/(w) * rr/(w) * rr/(w) * note: * only 0 can be written to clear the flag. bit bit name value description 6 cycle register compare match flag (cmf6) 0 [clearing condition] (initial value) read cmf6 when cmf6 =1, then write 0 in cmf6 1 [setting condition] tcnt6 = cylr6 4 cycle register compare match flag (cmf7) 0 [clearing condition] (initial value) read cmf7 when cmf7 =1, then write 0 in cmf7 1 [setting condition] tcnt7 = cylr7 2 cycle register compare match flag (cmf8) 0 [clearing condition] (initial value) read cmf8 when cmf8 =1, then write 0 in cmf8 1 [setting condition] tcnt8 = cylr8 0 cycle register compare match flag (cmf9) 0 [clearing condition] (initial value) read cmf9 when cmf9 =1, then write 0 in cmf9 1 [setting condition] tcnt9 = cylr9
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 712 of 818 rej09b0273-0500 h'ffff8243 (channel 6) 8/16 atu timer control registers 6 to 9 (tcr6 to tcr9) h'ffff8242 (channel 7) 8/16 h'ffff8245 (channel 8) 8/16 h'ffff8244 (channel 9) 8/16 bit:76543210 bit name: ????? cksel2 cksel1 cksel0 initial value:00000000 r/w:rrrrrr/wr/wr/w bit bit name value description 2, 1, 0 0 0 0 internal clock ": counting on ' (initial value) clock select 2 to 0 (cksel2 to cksel0) 1 internal clock ": counting on '/2 1 0 internal clock ": counting on '/4 1 internal clock ": counting on '/8 1 0 0 internal clock ": counting on '/16 1 internal clock ": counting on '/32 10 ? 1 ?
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 713 of 818 rej09b0273-0500 h'ffff8246 (channel 6) 16 atu free-running counters 6 to 9 (tcnt6 to tcnt9) h'ffff824e (channel 7) 16 h'ffff8256 (channel 8) 16 h'ffff825e (channel 9) 16 bit:1514131211109876543210 bit name: initial value:0000000000000001 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 (16-bit up-counter, initial value h'0001) counts input clock pulses h'ffff8248 (channel 6) 16 atu cycle registers 6 to 9 (cylr6 to cylr9) h'ffff8250 (channel 7) 16 h'ffff8258 (channel 8) 16 h'ffff8260 (channel 9) 16 bit:1514131211109876543210 bit name: initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 (cycle register) pwm cycle storage
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 714 of 818 rej09b0273-0500 h'ffff824a (channel 6) 16 atu buffer registers 6 to 9 (bfr6 to bfr9) h'ffff8252 (channel 7) 16 h'ffff825a (channel 8) 16 h'ffff8262 (channel 9) 16 bit:1514131211109876543210 bit name: initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 (buffer register) bfr value is transferred to dtr by compare match with corresponding cycle register, cylr h'ffff824c (channel 6) 16 atu duty registers 6 to 9 (dtr6 to dtr9) h'ffff8254 (channel 7) 16 h'ffff825c (channel 8) 16 h'ffff8264 (channel 9) 16 bit:1514131211109876543210 bit name: initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 (duty register) pwm duty storage
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 715 of 818 rej09b0273-0500 trigger selection register (tgsr) h'ffff8280 (channel 0) 8 atu bit:76543210 bit name: ????? trg0d ? trg0a initial value:00000000 r/w:rrrrrr/wrr/w bit bit name value description 2 0 input trigger is input pin (tid0) (initial value) icr0d input trigger (trg0d) 1 input trigger is channel 1 compare match signal (trg1a) 0 0 input trigger is input pin (tia0) (initial value) icr0a input trigger (trg0a) 1 input trigger is channel 1 compare match signal (trg1a)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 716 of 818 rej09b0273-0500 timer i/o control register 0a (tior0a) h'ffff8281 (channel 0) 8 atu bit:76543210 bit name: io0d1 io0d0 io0c1 io0c0 io0b1 io0b0 io0a1 io0a0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7, 6 0 0 input capture disabled (initial value) i/o control 0d1, d0 (io0d1, io0d0) 1 input capture to icr0d at rising edge 1 0 input capture to icr0d at falling edge 1 input capture to icr0d at both edges 5, 4 0 0 input capture disabled (initial value) i/o control 0c1, c0 (io0c1, io0c0) 1 input capture to icr0c at rising edge 1 0 input capture to icr0c at falling edge 1 input capture to icr0c at both edges 3, 2 0 0 input capture disabled (initial value) i/o control 0b1, b0 (io0b1, io0b0) 1 input capture to icr0b at rising edge 1 0 input capture to icr0b at falling edge 1 input capture to icr0b at both edges 1, 0 0 0 input capture disabled (initial value) i/o control 0a1, a0 (io0a1, io0a0) 1 input capture to icr0a at rising edge 1 0 input capture to icr0a at falling edge 1 input capture to icr0a at both edges
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 717 of 818 rej09b0273-0500 interval interrupt request register (itvrr) h'ffff8282 (channel 0) 8 atu bit:76543210 bit name: itvad3 itvad2 itvad1 itvad0 itve3 itve2 itve1 itve0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7 a/d converter interval activation bit 3 (itvad3) 0 a/d converter activation by atu is disabled (initial value) 1 a/d converter activation by atu is enabled 6 a/d converter interval activation bit 2 (itvad2) 0 a/d converter activation by atu is disabled (initial value) 1 a/d converter activation by atu is enabled 5 a/d converter interval activation bit 1 (itvad1) 0 a/d converter activation by atu is disabled (initial value) 1 a/d converter activation by atu is enabled 4 a/d converter interval activation bit 0 (itvad0) 0 a/d converter activation by atu is disabled (initial value) 1 a/d converter activation by atu is enabled 3 interval interrupt bit 3 (itve3) 0 interval interrupt generation is disabled (initial value) 1 interval interrupt generation is enabled 2 interval interrupt bit 2 (itve2) 0 interval interrupt generation is disabled (initial value) 1 interval interrupt generation is enabled 1 interval interrupt bit 1 (itve1) 0 interval interrupt generation is disabled (initial value) 1 interval interrupt generation is enabled 0 interval interrupt bit 0 (itve0) 0 interval interrupt generation is disabled (initial value) 1 interval interrupt generation is enabled
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 718 of 818 rej09b0273-0500 timer status register ah (tsrah) h'ffff8283 (channel 0) 8 atu bit:76543210 bit name: ???? iif3 iif2 iif1 iif0 initial value:00000000 r/w:rrrrr/(w) * r/(w) * r/(w) * r/(w) * note: * only 0 can be written to clear the flag. bit bit name value description 3 interval interrupt flag (iif3) 0 [clearing condition] (initial value) read iif3 when iif3 =1, then write 0 in iif3 1 [setting condition] when 1 is generated by and of itve3 in itvrr and bit 13 of tcnt0l 2 interval interrupt flag (iif2) 0 [clearing condition] (initial value) read iif2 when iif2 =1, then write 0 in iif2 1 [setting condition] when 1 is generated by and of itve2 in itvrr and bit 12 of tcnt0l 1 interval interrupt flag (iif1) 0 [clearing condition] (initial value) read iif1 when iif1 =1, then write 0 in iif1 1 [setting condition] when 1 is generated by and of itve1 in itvrr and bit 11 of tcnt0l 0 interval interrupt flag (iif0) 0 [clearing condition] (initial value) read iif0 when iif0 =1, then write 0 in iif0 1 [setting condition] when 1 is generated by and of itve0 in itvrr and bit 10 of tcnt0l
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 719 of 818 rej09b0273-0500 timer interrupt enable register a (tiera) h'ffff8284 (channel 0) 8 atu bit:76543210 bit name: ??? ove0 ice0d ice0c ice0b ice0a initial value:00000000 r/w: r r r r/w r/w r/w r/w r/w bit bit name value description 4 overflow interrupt enable (ove0) 0 ovi0 interrupt requested by ovf0 flag is disabled (initial value) 1 ovi0 interrupt requested by ovf0 flag is enabled 3 input capture interrupt enable (ice0d) 0 ici0d interrupt requested by icf0d flag is disabled (initial value) 1 ici0d interrupt requested by icf0d flag is enabled 2 input capture interrupt enable (ice0c) 0 ici0c interrupt requested by icf0c flag is disabled (initial value) 1 ici0c interrupt requested by icf0c flag is enabled 1 input capture interrupt enable (ice0b) 0 ici0b interrupt requested by icf0b flag is disabled (initial value) 1 ici0b interrupt requested by icf0b flag is enabled 0 input capture interrupt enable (ice0a) 0 ici0a interrupt requested by icf0a flag is disabled (initial value) 1 ici0a interrupt requested by icf0a flag is enabled
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 720 of 818 rej09b0273-0500 timer status register al (tsral) h'ffff8285 (channel 0) 8 atu bit:76543210 bit name: ??? ovf0 icf0d icf0c icf0b icf0a initial value:00000000 r/w: r r r r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * only 0 can be written to clear the flag. bit bit name value description 4overflow flag (ovf0) 0 [clearing condition] (initial value) read ovf0 when ovf0 =1, then write 0 in ovf0 1 [setting condition] tcnt0 overflowed from h'ffffffff to h'00000000 3 input capture flag (icf0d) 0 [clearing condition] (initial value) read icf0d when icf0d =1, then write 0 in icf0d 1 [setting condition] tcnt0 value is transferred to input capture register icr0d by an input capture signal 2 input capture flag (icf0c) 0 [clearing condition] (initial value) read icf0c when icf0c =1, then write 0 in icf0c 1 [setting condition] tcnt0 value is transferred to input capture register icr0c by an input capture signal 1 input capture flag (icf0b) 0 [clearing conditions] (initial value) 1. read icf0b when icf0b =1, then write 0 in icf0b 2. when cleared by the dmac in data transfer 1 [setting condition] tcnt0 value is transferred to input capture register icr0b by an input capture signal 0 input capture flag (icf0a) 0 [clearing condition] (initial value) read icf0a when icf0a =1, then write 0 in icf0a 1 [setting condition] tcnt0 value is transferred to input capture register icr0a by an input capture signal
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 721 of 818 rej09b0273-0500 h'ffff8288 (channel 0) 32 atu free-running counters 0h, 0l (tcnt0h, tcnt0l) h'ffff828a (channel 0) bit: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name: initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit:1514131211109876543210 bit name: initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 31 ? 0 (32-bit up-counter, initial value h'00000000) counts input clock pulses
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 722 of 818 rej09b0273-0500 h'ffff828c (channel 0) 32 atu h'ffff828e (channel 0) input capture registers 0ah, l to 0dh, l (icr0ah, l to icr0dh, l) h'ffff8290 (channel 0) 32 h'ffff8292 (channel 0) h'ffff8294 (channel 0) 32 h'ffff8296 (channel 0) h'ffff8298 (channel 0) 32 h'ffff829a (channel 0) bit: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name: initial value:0000000000000000 r/w:rrrrrrrrrrrrrrrr bit:1514131211109876543210 bit name: initial value:0000000000000000 r/w:rrrrrrrrrrrrrrrr bit bit name description 31 ? 0 (dedicated input capture register) stores tcnt value when input capture signal is generated
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 723 of 818 rej09b0273-0500 h'ffff82c1 (channel 1, 1a) 8/16 atu h'ffff82c2 (channel 1, 1b) 8/16 timer i/o control registers 1a to 1c, 2a (tior1a to tior1c, tior2a) h'ffff82c3 (channel 1, 1c) 8/16 h'ffff82c7 (channel 2, 2a) 8/16 tior1a bit:76543210 bit name: ? io1b2 io1b1 io1b0 ? io1a2 io1a1 io1a0 initial value:00000000 r/w: r r/w r/w r/w r r/w r/w r/w tior1b bit:76543210 bit name: ? io1d2 io1d1 io1d0 ? io1c2 io1c1 io1c0 initial value:00000000 r/w: r r/w r/w r/w r r/w r/w r/w tior1c bit:76543210 bit name: ? io1f2 io1f1 io1f0 ? io1e2 io1e1 io1e0 initial value:00000000 r/w: r r/w r/w r/w r r/w r/w r/w tior2a bit:76543210 bit name: ? io2b2 io2b1 io2b0 ? io2a2 io2a1 io2a0 initial value:00000000 r/w: r r/w r/w r/w r r/w r/w r/w
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 724 of 818 rej09b0273-0500 bit bit name value description 6, 5, 4 0 0 0 0 output regardless of compare match (initial value ) 1 0 output at gr compare match i/o control 1b2 ? ib0, id2 ? id0, if2 ? 1f0, 2b2 ? 2b0 (io1b2 ? io1b0, io1d2 ? io1d0, io1f2 ? io1f0, io2b2 ? io2b0) 10 gr is output compare register 1 output at gr compare match 1 output toggles at gr compare match 1 0 0 input capture disabled 1 input capture to gr at rising edge 10 gr is input capture register input capture to gr at falling edge 1 input capture to gr at both edges 2, 1, 0 0 0 0 0 output regardless of compare match (initial value ) 1 gr is output compare register 0 output at gr compare match i/o control 1a2 ? 1a0, ic2 ? ic0, 1e2 ? 1e0, 2a2 ? 2a0 (io1a2 ? io1a0, io1c2 ? io1c0, io1e2 ? io1e0, io2a2 ? io2a0) 1 0 1 output at gr compare match 1 output toggles at gr compare match 1 0 0 input capture disabled 1 input capture to gr at rising edge 10 gr is input capture register input capture to gr at falling edge 1 input capture to gr at both edges
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 725 of 818 rej09b0273-0500 timer interrupt enable register b (tierb) h'ffff82c4 (channel 1) 8 atu bit:76543210 bit name: ? ove1 ime1f ime1e ime1d ime1c ime1b ime1a initial value:00000000 r/w: r r/w r/w r/w r/w r/w r/w r/w bit bit name value description 6 overflow interrupt enable (ove1) 0 ovi1 interrupt requested by ovf1 flag is disabled (initial value) 1 ovi1 interrupt requested by ovf1 flag is enabled 5 0 imi1f interrupt requested by imf1f flag is disabled (initial value) input capture/compare match interrupt enable (ime1f) 1 imi1f interrupt requested by imf1f flag is enabled 4 0 imi1e interrupt requested by imf1e flag is disabled (initial value) input capture/compare match interrupt enable (ime1e) 1 imi1e interrupt requested by imf1e flag is enabled 3 0 imi1d interrupt requested by imf1d flag is disabled (initial value) input capture/compare match interrupt enable (ime1d) 1 imi1d interrupt requested by imf1d flag is enabled 2 0 imi1c interrupt requested by imf1c flag is disabled (initial value) input capture/compare match interrupt enable (ime1c) 1 imi1c interrupt requested by imf1c flag is enabled 1 0 imi1b interrupt requested by imf1b flag is disabled (initial value) input capture/compare match interrupt enable (ime1b) 1 imi1b interrupt requested by imf1b flag is enabled 0 0 imi1a interrupt requested by imf1a flag is disabled (initial value) input capture/compare match interrupt enable (ime1a) 1 imi1a interrupt requested by imf1a flag is enabled
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 726 of 818 rej09b0273-0500 timer status register b (tsrb) h'ffff82c5 (channel 1) 8 atu bit:76543210 bit name: ? ovf1 imf1f imf1e imf1d imf1c imf1b imf1a initial value:00000000 r/w: r r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * only 0 can be written to clear the flag. bit bit name value description 6overflow flag (ovf1) 0 [clearing condition] (initial value) read ovf1 when ovf1 =1, then write 0 in ovf1 1 [setting condition] tcnt1 overflowed from h'ffff to h'0000 5 0 [clearing condition] (initial value) read imf1f when imf1f =1, then write 0 in imf1f input capture/ compare match flag (imf1f) 1 [setting conditions] 1. tcnt1 value is transferred to gr1f by an input capture signal when gr1f functions as an input capture register 2. tcnt1 = gr1f when gr1f functions as an output compare register 4 0 [clearing condition] (initial value) read imf1e when imf1e =1, then write 0 in imf1e input capture/ compare match flag (imf1e) 1 [setting conditions] 1. tcnt1 value is transferred to gr1e by an input capture signal when gr1e functions as an input capture register 2. tcnt1 = gr1e when gr1e functions as an output compare register 3 0 [clearing condition] (initial value) read imf1d when imf1d =1, then write 0 in imf1d input capture/ compare match flag (imf1d) 1 [setting conditions] 1. tcnt1 value is transferred to gr1d by an input capture signal when gr1d functions as an input capture register 2. tcnt1 = gr1d when gr1d functions as an output compare register
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 727 of 818 rej09b0273-0500 bit bit name value description 2 0 [clearing condition] (initial value) read imf1c when imf1c =1, then write 0 in imf1c input capture/ compare match flag (imf1c) 1 [setting conditions] 1. tcnt1 value is transferred to gr1c by an input capture signal when gr1c functions as an input capture register 2. tcnt1 = gr1c when gr1c functions as an output compare register 1 0 [clearing condition] (initial value) read imf1b when imf1b =1, then write 0 in imf1b input capture/ compare match flag (imf1b) 1 [setting conditions] 1. tcnt1 value is transferred to gr1b by an input capture signal when gr1b functions as an input capture register 2. tcnt1 = gr1b when gr1b functions as an output compare register 0 0 [clearing condition] (initial value) read imf1a when imf1a =1, then write 0 in imf1a input capture/ compare match flag (imf1a) 1 [setting conditions] 1. tcnt1 value is transferred to gr1a by an input capture signal when gr1a functions as an input capture register 2. tcnt1 = gr1a when gr1a functions as an output compare register
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 728 of 818 rej09b0273-0500 timer interrupt enable register c (tierc) h'ffff82c8 (channel 2) 8 atu bit:76543210 bit name: ????? ove2 ime2b ime2a initial value:00000000 r/w:rrrrrr/wr/wr/w bit bit name value description 2 overflow interrupt enable (ove2) 0 ovi2 interrupt requested by ovf2 flag is disabled (initial value) 1 ovi2 interrupt requested by ovf2 flag is enabled 1 0 imi2b interrupt requested by imf2b flag is disabled (initial value) input capture/compare match interrupt enable (ime2b) 1 imi2b interrupt requested by imf2b flag is enabled 0 0 imi2a interrupt requested by imf2a flag is disabled (initial value) input capture/compare match interrupt enable (ime2a) 1 imi2a interrupt requested by imf2a flag is enabled
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 729 of 818 rej09b0273-0500 timer status register c (tsrc) h'ffff82c9 (channel 2) 8 atu bit:76543210 bit name: ????? ovf2 imf2b imf2a initial value:00000000 r/w:rrrrrr/(w) * r/(w) * r/(w) * note: * only 0 can be written to clear the flag. bit bit name value description 2 overflow flag (ovf2) 0 [clearing condition] (initial value) read ovf2 when ovf2 =1, then write 0 in ovf2 1 [setting condition] tcnt2 overflowed from h'ffff to h'0000 1 input capture/compare match flag (imf2b) 0 [clearing condition] (initial value) read imf2b when imf2b =1, then write 0 in imf2b 1 [setting conditions] 1. tcnt2 value is transferred to gr2b by an input capture signal when gr2b functions as an input capture register 2. tcnt2 = gr2b when gr2b functions as an output compare register 0 input capture/compare match flag (imf2a) 0 [clearing condition] (initial value) read imf2a when imf2a =1, then write 0 in imf2a 1 [setting conditions] 1. tcnt2 value is transferred to gr2a by an input capture signal when gr2a functions as an input capture register 2. tcnt2 = gr2a when gr2a functions as an output compare register
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 730 of 818 rej09b0273-0500 h'ffff82cc (channel 2, 2a) 16 atu general registers 2a, 2b (gr2a, gr2b) h'ffff82ce (channel 2, 2b) 16 bit:1514131211109876543210 bit name: initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 (dual-function input capture/output compare register) 1. input capture register: stores tcnt2 value when input capture signal is generated 2. output compare register: set with compare match value h'ffff82d2 (channel 1, 1a) 16 atu general registers 1a to 1f (gr1a to gr1f) h'ffff82d4 (channel 1, 1b) 16 h'ffff82d6 (channel 1, 1c) 16 h'ffff82d8 (channel 1, 1d) 16 h'ffff82da (channel 1, 1e) 16 h'ffff82dc (channel 1, 1f) 16 bit:1514131211109876543210 bit name: initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 (dual-function input capture/output compare register) 1. input capture register: stores tcnt1 value when input capture signal is generated 2. output compare register: set with compare match value
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 731 of 818 rej09b0273-0500 offset base register (osbr) h'ffff82de (channel 1) 16 atu bit:1514131211109876543210 bit name: initial value:0000000000000000 r/w:rrrrrrrrrrrrrrrr bit bit name description 15 ? 0 dedicated input capture register with signal from channel 0 icr0a as input trigger stores tcnt1 value at edge(s) selected by tiora bits 0 and 1
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 732 of 818 rej09b0273-0500 timer control register 10 (tcr10) h'ffff82e0 (channel 10) 8/16 atu bit:76543210 bit name: ? cksel2a cksel1a cksel0a ? cksel2b cksel1b cksel0b initial value:00000000 r/w: r r/w r/w r/w r r/w r/w r/w bit bit name value description 6, 5, 4 0 0 0 internal clock ": counting on ' (initial value) clock select 2a ? 0a (cksel2a ? cksel0a) 1 internal clock ": counting on '/2 1 0 internal clock ": counting on '/4 1 internal clock ": counting on '/8 1 0 0 internal clock ": counting on '/16 1 internal clock ": counting on '/32 10 ? 1 ? 2, 1, 0 0 0 0 internal clock ": counting on ' (initial value) clock select 2b ? 0b (cksel2b ? cksel0b) 1 internal clock ": counting on '/2 1 0 internal clock ": counting on '/4 1 internal clock ": counting on '/8 1 0 0 internal clock ": counting on '/16 1 internal clock ": counting on '/32 10 ? 1 ?
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 733 of 818 rej09b0273-0500 timer connection register (tcnr) h'ffff82e1 (channel 10) 8/16 atu bit:76543210 bit name: cn10h cn10g cn10f cn10e cn10d cn10c cn10b cn10a initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7 connection flag 10h (cn10h) 0 connection between dst10h and off2b is disabled (initial value) 1 connection between dst10h and off2b is enabled 6 connection flag 10g (cn10g) 0 connection between dst10g and off2a is disabled (initial value) 1 connection between dst10g and off2a is enabled 5 connection flag 10f (cn10f) 0 connection between dst10f and off1f is disabled (initial value) 1 connection between dst10f and off1f is enabled 4 connection flag 10e (cn10e) 0 connection between dst10e and off1e is disabled (initial value) 1 connection between dst10e and off1e is enabled 3 connection flag 10d (cn10d) 0 connection between dst10d and off1d is disabled (initial value) 1 connection between dst10d and off1d is enabled 2 connection flag 10c (cn10c) 0 connection between dst10c and off1c is disabled (initial value) 1 connection between dst10c and off1c is enabled 1 connection flag 10b (cn10b) 0 connection between dst10b and off1b is disabled (initial value) 1 connection between dst10b and off1b is enabled 0 connection flag 10a (cn10a) 0 connection between dst10a and off1a is disabled (initial value) 1 connection between dst10a and off1a is enabled
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 734 of 818 rej09b0273-0500 timer interrupt enable register f (tierf) h'ffff82e2 (channel 10) 8 atu bit:76543210 bit name: ose10h ose10g ose10f ose10e ose10d ose10c ose10b ose10a initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7 0 osi10h interrupt requested by osf10h flag is disabled (initial value) one-shot pulse interrupt enable (ose10h) 1 osi10h interrupt requested by osf10h flag is enabled 6 0 osi10g interrupt requested by osf10g flag is disabled (initial value) one-shot pulse interrupt enable (ose10g) 1 osi10g interrupt requested by osf10g flag is enabled 5 0 osi10f interrupt requested by osf10f flag is disabled (initial value) one-shot pulse interrupt enable (ose10f) 1 osi10f interrupt requested by osf10f flag is enabled 4 0 osi10e interrupt requested by osf10e flag is disabled (initial value) one-shot pulse interrupt enable (ose10e) 1 osi10e interrupt requested by osf10e flag is enabled 3 0 osi10d interrupt requested by osf10d flag is disabled (initial value) one-shot pulse interrupt enable (ose10d) 1 osi10d interrupt requested by osf10d flag is enabled 2 0 osi10c interrupt requested by osf10c flag is disabled (initial value) one-shot pulse interrupt enable (ose10c) 1 osi10c interrupt requested by osf10c flag is enabled 1 0 osi10b interrupt requested by osf10b flag is disabled (initial value) one-shot pulse interrupt enable (ose10b) 1 osi10b interrupt requested by osf10b flag is enabled 0 0 osi10a interrupt requested by osf10a flag is disabled (initial value) one-shot pulse interrupt enable (ose10a) 1 osi10a interrupt requested by osf10a flag is enabled
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 735 of 818 rej09b0273-0500 timer status register f (tsrf) h'ffff82e3 (channel 10) 8 atu bit:76543210 bit name: osf10h osf10g osf10f osf10e osf10d osf10c osf10b osf10a initial value:00000000 r/w: r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * only 0 can be written to clear the flag. bit bit name value description 7 one-shot pulse flag (osf10h) 0 [clearing condition] (initial value) read osf10h when osf10h =1, then write 0 in osf10h 1 [setting condition] down-counter (dcnt10h) value underflowed 6 one-shot pulse flag (osf10g) 0 [clearing condition] (initial value) read osf10g when osf10g =1, then write 0 in osf10g 1 [setting condition] down-counter (dcnt10g) value underflowed 5 one-shot pulse flag (osf10f) 0 [clearing condition] (initial value) read osf10f when osf10f =1, then write 0 in osf10f 1 [setting condition] down-counter (dcnt10f) value underflowed 4 one-shot pulse flag (osf10e) 0 [clearing condition] (initial value) read osf10e when osf10e =1, then write 0 in osf10e 1 [setting condition] down-counter (dcnt10e) value underflowed 3 one-shot pulse flag (osf10d) 0 [clearing condition] (initial value) read osf10d when osf10d =1, then write 0 in osf10d 1 [setting condition] down-counter (dcnt10d) value underflowed 2 one-shot pulse flag (osf10c) 0 [clearing condition] (initial value) read osf10c when osf10c =1, then write 0 in osf10c 1 [setting condition] down-counter (dcnt10c) value underflowed
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 736 of 818 rej09b0273-0500 bit bit name value description 1 one-shot pulse flag (osf10b) 0 [clearing condition] (initial value) read osf10b when osf10b =1, then write 0 in osf10b 1 [setting condition] down-counter (dcnt10b) value underflowed 0 one-shot pulse flag (osf10a) 0 [clearing condition] (initial value) read osf10a when osf10a =1, then write 0 in osf10a 1 [setting condition] down-counter (dcnt10a) value underflowed
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 737 of 818 rej09b0273-0500 down-count start register (dstr) h'ffff82e5 (channel 10) 8 atu bit:76543210 bit name: dst10h dst10g dst10f dst10e dst10d dst10c dst10b dst10a initial value:00000000 r/w: r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * only 1 can be written. bit bit name value description 7 down-count start flag 10h (dst10h) 0 dcnt10h is halted (initial value) [clearing condition] dcnt10h value underflowed 1 dcnt10h counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set by gr2b compare-match, or by user program 6 down-count start flag 10g (dst10g) 0 dcnt10g is halted (initial value) [clearing condition] dcnt10g value underflowed 1 dcnt10g counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set by gr2a compare-match, or by user program 5 down-count start flag 10f (dst10f) 0 dcnt10f is halted (initial value) [clearing condition] dcnt10f value underflowed 1 dcnt10f counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set by gr1f compare-match, or by user program
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 738 of 818 rej09b0273-0500 bit bit name value description 4 down-count start flag 10e (dst10e) 0 dcnt10e is halted (initial value) [clearing condition] dcnt10e value underflowed 1 dcnt10e counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set by gr1e compare-match, or by user program 3 down-count start flag 10d (dst10d) 0 dcnt10d is halted (initial value) [clearing condition] dcnt10d value underflowed 1 dcnt10d counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set by gr1d compare-match, or by user program 2 down-count start flag 10c (dst10c) 0 dcnt10c is halted (initial value) [clearing condition] dcnt10c value underflowed 1 dcnt10c counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set by gr1c compare-match, or by user program 1 down-count start flag 10b (dst10b) 0 dcnt10b is halted (initial value) [clearing condition] dcnt10b value underflowed 1 dcnt10b counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set by gr1b compare-match, or by user program 0 down-count start flag 10a (dst10a) 0 dcnt10a is halted (initial value) [clearing condition] dcnt10a value underflowed 1 dcnt10a counts [setting conditions] one-shot pulse function: set by user program offset one-shot pulse function: set by gr1a compare-match, or by user program
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 739 of 818 rej09b0273-0500 prescaler register 1 (pscr1) h'ffff82e9 (all channels) 8atu bit:76543210 bit name: ??? psce pscd pscc pscb psca initial value:00000000 r/w: r r r r/w r/w r/w r/w r/w bit bit name description 4 ? 0 (prescaler register) counter clock ' value
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 740 of 818 rej09b0273-0500 timer start register (tstr) h'ffff82ea (all channels) 16 atu bit: 15 14 13 12 11 10 9 8 bit name: ?????? str9 str8 initial value:00000000 r/w:rrrrrrr/wr/w bit:76543210 bit name: str7 str6 str5 str4 str3 str2 str1 str0 initial value:00000001 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 9 counter start 9 (str9) 0 tcnt9 is halted (initial value) 1 tcnt9 counts 8 counter start 8 (str8) 0 tcnt8 is halted (initial value) 1 tcnt8 counts 7 counter start 7 (str7) 0 tcnt7 is halted (initial value) 1 tcnt7 counts 6 counter start 6 (str6) 0 tcnt6 is halted (initial value) 1 tcnt6 counts 5 counter start 5 (str5) 0 tcnt5 is halted (initial value) 1 tcnt5 counts 4 counter start 4 (str4) 0 tcnt4 is halted (initial value) 1 tcnt4 counts 3 counter start 3 (str3) 0 tcnt3 is halted (initial value) 1 tcnt3 counts 2 counter start 2 (str2) 0 tcnt2 is halted (initial value) 1 tcnt2 counts 1 counter start 1 (str1) 0 tcnt1 is halted (initial value) 1 tcnt1 counts 0 counter start 0 (str0) 0 tcnt0 is halted (initial value) 1 tcnt0 counts
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 741 of 818 rej09b0273-0500 h'ffff82f0 (channel 10, 10a) 16 atu down-counters 10a to 10h (dcnt10a to dcnt10h) h'ffff82f2 (channel 10, 10b) 16 h'ffff82f4 (channel 10, 10c) 16 h'ffff82f6 (channel 10, 10d) 16 h'ffff82f8 (channel 10, 10e) 16 h'ffff82fa (channel 10, 10f) 16 h'ffff82fc (channel 10, 10g) 16 h'ffff82fe (channel 10, 10h) 16 bit:1514131211109876543210 bit name: initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 (down-counter) decremented by input clock pulses
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 742 of 818 rej09b0273-0500 h'ffff8348 (ipra) 8/16/32 intc interrupt priority registers a to h (ipra to iprh) h'ffff834a (iprb) h'ffff834c (iprc) h'ffff834e (iprd) h'ffff8350 (ipre) h'ffff8352 (iprf) h'ffff8354 (iprg) h'ffff8356 (iprh) bit:1514131211109876543210 bit name: initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit register 15?12 11?8 7?4 3?0 interrupt priority register a irq0 irq1 irq2 irq3 interrupt priority register b irq4 irq5 irq6 irq7 interrupt priority register c dmac0, 1 dmac2, 3 atu01 atu02 interrupt priority register d atu03 atu11 atu12 atu13 interrupt priority register e atu2 atu31 atu32 atu41 interrupt priority register f atu42 atu5 atu6 ? 9 atu101 interrupt priority register g atu102 atu103 cmt0, a/d0 cmt1, a/d1 interrupt priority register h sci0 sci1 sci2 wdt
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 743 of 818 rej09b0273-0500 interrupt control register (icr) h'ffff8358 8/16/32 intc bit: 15 14 13 12 11 10 9 8 bit name: nmil ?????? nmie initial value: * 0000000 r/w:rrrrrrrr/w bit:76543210 bit name: irq0s irq1s irq2s irq3s irq4s irq5s irq6s irq7s initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w note: * 1 when the nmi pin is high, 0 when low. bit bit name value description 15 nmi input level (nmil) 0 low level input at nmi pin 1 high level input at nmi pin 8 nmi edge select (nmie) 0 interrupt request detected on falling edge of nmi input (initial value) 1 interrupt request detected on rising edge of nmi input 7 ? 0irq 0 to irq 7 sense select (irq0s to irq7s) 0 interrupt request detected on low level of irq input (initial value) 1 interrupt request detected on falling edge of irq input
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 744 of 818 rej09b0273-0500 irq status register (isr) h'ffff835a 8/16/32 intc bit: 15 14 13 12 11 10 9 8 bit name: ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 bit name: irq0f irq1f irq2f irq3f irq4f irq5f irq6f irq7f initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value detection setting description 7 ? 0 irq0 to irq7 flags (irq0f to irq7f) 0 level detection there is no irqn interrupt request [clearing condition] irqn input is high edge detection irqn interrupt request has not been detected (initial value) [clearing conditions] 1. read irqnf when irqnf =1, then write 0 in irqnf 2. irqn interrupt exception handling is carried out 1 level detection there is an irqn interrupt request [setting condition] irqn input is low edge detection irqn interrupt request has been detected [setting condition] falling edge in irqn input
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 745 of 818 rej09b0273-0500 port a data register (padr) h'ffff8380 8/16 port a bit: 15 14 13 12 11 10 9 8 bit name: pa15dr pa14dr pa13dr pa12dr pa11dr pa10dr pa9dr pa8dr initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pa7dr pa6dr pa5dr pa4dr pa3dr pa2dr pa1dr pa0dr initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit value pin function read write 15 ? 0 0 generic input pin state padr can be written to, but the pin state is not affected other than generic input pin state padr can be written to, but the pin state is not affected 1 generic output padr value write value is output at the pin ( pod pin is high) high-impedance regardless of padr value ( pod pin is low) other than generic output padr value padr can be written to, but the pin state is not affected
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 746 of 818 rej09b0273-0500 port a io register (paior) h'ffff8382 8/16 port a bit: 15 14 13 12 11 10 9 8 bit name: pa15ior pa14ior pa13ior pa12ior pa11ior pa10ior pa9ior pa8ior initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pa7ior pa6ior pa5ior pa4ior pa3ior pa2ior pa1ior pa0ior initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 ? 0 0 input (initial value) port a io register (pa15ior to pa0ior) 1 output
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 747 of 818 rej09b0273-0500 port a control register (pacr) h'ffff8384 8/16 port a bit: 15 14 13 12 11 10 9 8 bit name: pa15md pa14md pa13md pa12md pa11md pa10md pa9md pa8md initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pa7md pa6md pa5md pa4md pa3md pa2md pa1md pa0md initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w pin function bit bit name value expanded mode with rom disabled expanded mode with rom enabled single-chip mode 15 pa15 mode bit (pa15md) 0 address output (a15) (initial value) generic input/output (pa15) (initial value) generic input/output (pa15) (initial value) 1 address output (a15) address output (a15) generic input/output (pa15) 14 pa14 mode bit (pa14md) 0 address output (a14) (initial value) generic input/output (pa14) (initial value) generic input/output (pa14) (initial value) 1 address output (a14) address output (a14) generic input/output (pa14) 13 pa13 mode bit (pa13md) 0 address output (a13) (initial value) generic input/output (pa13) (initial value) generic input/output (pa13) (initial value) 1 address output (a13) address output (a13) generic input/output (pa13) 12 pa12 mode bit (pa12md) 0 address output (a12) (initial value) generic input/output (pa12) (initial value) generic input/output (pa12) (initial value) 1 address output (a12) address output (a12) generic input/output (pa12) 11 pa11 mode bit (pa11md) 0 address output (a11) (initial value) generic input/output (pa11) (initial value) generic input/output (pa11) (initial value) 1 address output (a11) address output (a11) generic input/output (pa11) 10 pa10 mode bit (pa10md) 0 address output (a10) (initial value) generic input/output (pa10) (initial value) generic input/output (pa10) (initial value) 1 address output (a10) address output (a10) generic input/output (pa10) 9 pa9 mode bit (pa9md) 0 address output (a9) (initial value) generic input/output (pa9) (initial value) generic input/output (pa9) (initial value) 1 address output (a9) address output (a9) generic input/output (pa9)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 748 of 818 rej09b0273-0500 pin function bit bit name value expanded mode with rom disabled expanded mode with rom enabled single-chip mode 8 pa8 mode bit (pa8md) 0 address output (a8) (initial value) generic input/output (pa8) (initial value) generic input/output (pa8) (initial value) 1 address output (a8) address output (a8) generic input/output (pa8) 7 pa7 mode bit (pa7md) 0 address output (a7) (initial value) generic input/output (pa7) (initial value) generic input/output (pa7) (initial value) 1 address output (a7) address output (a7) generic input/output (pa7) 6 pa6 mode bit (pa6md) 0 address output (a6) (initial value) generic input/output (pa6) (initial value) generic input/output (pa6) (initial value) 1 address output (a6) address output (a6) generic input/output (pa6) 5 pa5 mode bit (pa5md) 0 address output (a5) (initial value) generic input/output (pa5) (initial value) generic input/output (pa5) (initial value) 1 address output (a5) address output (a5) generic input/output (pa5) 4 pa4 mode bit (pa4md) 0 address output (a4) (initial value) generic input/output (pa4) (initial value) generic input/output (pa4) (initial value) 1 address output (a4) address output (a4) generic input/output (pa4) 3 pa3 mode bit (pa3md) 0 address output (a3) (initial value) generic input/output (pa3) (initial value) generic input/output (pa3) (initial value) 1 address output (a3) address output (a3) generic input/output (pa3) 2 pa2 mode bit (pa2md) 0 address output (a2) (initial value) generic input/output (pa2) (initial value) generic input/output (pa2) (initial value) 1 address output (a2) address output (a2) generic input/output (pa2) 1 pa1 mode bit (pa1md) 0 address output (a1) (initial value) generic input/output (pa1) (initial value) generic input/output (pa1) (initial value) 1 address output (a1) address output (a1) generic input/output (pa1) 0 pa0 mode bit (pa0md) 0 address output (a0) (initial value) generic input/output (pa0) (initial value) generic input/output (pa0) (initial value) 1 address output (a0) address output (a0) generic input/output (pa0)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 749 of 818 rej09b0273-0500 port b data register (pbdr) h'ffff8386 8/16 port b bit: 15 14 13 12 11 10 9 8 bit name: ?? pb11dr pb10dr pb9dr pb8dr pb7dr pb6dr initial value:11000000 r/w: r r r/w r/w r/w r/w r/w r/w bit:76543210 bit name: ?? pb5dr pb4dr pb3dr pb2dr pb1dr pb0dr initial value:11000000 r/w: r r r/w r/w r/w r/w r/w r/w bit value pin function read write 13, 5 ? 0 0 generic input pin state pbdr can be written to, but the pin state is not affected other than generic input pin state pbdr can be written to, but the pin state is not affected 1 generic output pbdr value write value is output at the pin ( pod pin is high) high-impedance regardless of pbdr value ( pod pin is low) other than generic output pbdr value pbdr can be written to, but the pin state is not affected 12 ? 8 0 generic input pin state pbdr can be written to, but the pin state is not affected other than generic input pin state pbdr can be written to, but the pin state is not affected 1 generic output pbdr value write value is output at the pin other than generic output pbdr value pbdr can be written to, but the pin state is not affected
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 750 of 818 rej09b0273-0500 port b io register (pbior) h'ffff8388 8/16 port b bit: 15 14 13 12 11 10 9 8 bit name: ?? pb11ior pb10ior pb9ior pb8ior pb7ior pb6ior initial value:11000000 r/w: r r r/w r/w r/w r/w r/w r/w bit:76543210 bit name: ?? pb5ior pb4ior pb3ior pb2ior pb1ior pb0ior initial value:11000000 r/w: r r r/w r/w r/w r/w r/w r/w bit bit name value description 0 input (initial value) 13 ? 8, 5 ? 0 port b io register (pb11ior to pb6ior, pb5ior to pb0ior) 1 output
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 751 of 818 rej09b0273-0500 port b control register (pbcr) h'ffff838a 8/16 port b bit: 15 14 13 12 11 10 9 8 bit name: ? pb11md1 pb11md0 pb10md pb9md pb8md pb7md pb6md initial value:10000000 r/w: r r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: ?? pb5md pb4md pb3md pb2md pb1md pb0md initial value:11000000 r/w: r r r/w r/w r/w r/w r/w r/w pin function bit bit name value expanded mode with rom disabled expanded mode with rom enabled single-chip mode 14, 13 0 0 address output (a21) (initial value) generic input/output (pb11) (initial value) generic input/output (pb11) (initial value) 1 address output (a21) address output (a21) generic input/output (pb11) 1 0 address output (a21) port output disable input ( pod ) port output disable input ( pod ) pb11 mode bit 1, 0 (pb11md1, pb11md0) 1 reserved reserved reserved 12 pb10 mode bit (pb10md) 0 address output (a20) (initial value) generic input/output (pb10) (initial value) generic input/output (pb10) (initial value) 1 address output (a20) address output (a20) generic input/output (pb10) 11 pb9 mode bit (pb9md) 0 address output (a19) (initial value) generic input/output (pb9) (initial value) generic input/output (pb9) (initial value) 1 address output (a19) address output (a19) generic input/output (pb9) 10 pb8 mode bit (pb8md) 0 address output (a18) (initial value) generic input/output (pb8) (initial value) generic input/output (pb8) (initial value) 1 address output (a18) address output (a18) generic input/output (pb8) 9 pb7 mode bit (pb7md) 0 address output (a17) (initial value) generic input/output (pb7) (initial value) generic input/output (pb7) (initial value) 1 address output (a17) address output (a17) generic input/output (pb7) 8 pb6 mode bit (pb6md) 0 address output (a16) (initial value) generic input/output (pb6) (initial value) generic input/output (pb6) (initial value) 1 address output (a16) address output (a16) generic input/output (pb6)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 752 of 818 rej09b0273-0500 pin function bit bit name value expanded mode with rom disabled expanded mode with rom enabled single-chip mode 5 0 generic input/output (pb5) (initial value) pb5 mode bit (pb5md) 1 atu clock input (tclkb) 4 0 generic input/output (pb4) (initial value) pb4 mode bit (pb4md) 1 atu clock input (tclka) 3 0 generic input/output (pb3) (initial value) pb3 mode bit (pb3md) 1 atu pwm output (to9) 2 0 generic input/output (pb2) (initial value) pb2 mode bit (pb2md) 1 atu pwm output (to8) 1 0 generic input/output (pb1) (initial value) pb1 mode bit (pb1md) 1 atu pwm output (to7) 0 0 generic input/output (pb0) (initial value) pb0 mode bit (pb0md) 1 atu pwm output (to6)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 753 of 818 rej09b0273-0500 port c data register (pcdr) h'ffff8390 8/16 port c bit: 15 14 13 12 11 10 9 8 bit name: ? pc14dr pc13dr pc12dr pc11dr pc10dr pc9dr pc8dr initial value:10000000 r/w: r r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pc7dr pc6dr pc5dr pc4dr pc3dr pc2dr pc1dr pc0dr initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit value pin function read write 14 ? 0 0 generic input pin state pcdr can be written to, but the pin state is not affected other than generic input pin state pcdr can be written to, but the pin state is not affected 1 generic output pcdr value write value is output at the pin ( pod pin is high) high-impedance regardless of pcdr value ( pod pin is low) other than generic output pcdr value pcdr can be written to, but the pin state is not affected
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 754 of 818 rej09b0273-0500 port c io register (pcior) h'ffff8392 8/16 port c bit: 15 14 13 12 11 10 9 8 bit name: ? pc14ior pc13ior pc12ior pc11ior pc10ior pc9ior pc8ior initial value:10000000 r/w: r r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pc7ior pc6ior pc5ior pc4ior pc3ior pc2ior pc1ior pc0ior initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 14 ? 0 0 input (initial value) port c io register (pc14ior to pc0ior) 1 output
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 755 of 818 rej09b0273-0500 h'ffff8394 (pccr1) 8/16 port c port c control registers 1 and 2 (pccr1, pccr2) h'ffff8396 (pccr2) pccr1 bit: 15 14 13 12 11 10 9 8 bit name: ?? pc14md1 pc14md0 pc13md1 pc13md0 pc12md1 pc12md0 initial value:11000000 r/w: r r r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pc11md1 pc11md0 pc10md1 pc10md0 pc9md1 pc9md0 pc8md1 pc8md0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w pin function bit bit name value expanded mode single-chip mode 13, 12 0 0 generic input/output (pc14) (initial value) generic input/output (pc14) (initial value) pc14 mode bit 1, 0 (pc14md1, pc14md0) 1 atu one-shot pulse output (toh10) atu one-shot pulse output (toh10) 1 0 reserved reserved 1 reserved reserved 11, 10 0 0 generic input/output (pc13) (initial value) generic input/output (pc13) (initial value) pc13 mode bit 1, 0 (pc13md1, pc13md0) 1 atu one-shot pulse output (tog10) atu one-shot pulse output (tog10) 1 0 reserved reserved 1 reserved reserved 9, 8 0 0 generic input/output (pc12) (initial value) generic input/output (pc12) (initial value) pc12 mode bit 1, 0 (pc12md1, pc12md0) 1 atu one-shot pulse output (tof10) atu one-shot pulse output (tof10) 10dmac dreq1 acknowledge signal output (drak1) dmac dreq1 acknowledge signal output (drak1) 1 reserved reserved
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 756 of 818 rej09b0273-0500 pin function bit bit name value expanded mode single-chip mode 7, 6 0 0 generic input/output (pc11) (initial value) generic input/output (pc11) (initial value) pc11 mode bit 1, 0 (pc11md1, pc11md0) 1 atu one-shot pulse output (toe10) atu one-shot pulse output (toe10) 10dmac dreq0 acknowledge signal output (drak0) dmac dreq0 acknowledge signal output (drak0) 1 reserved reserved 5, 4 0 0 generic input/output (pc10) (initial value) generic input/output (pc10) (initial value) pc10 mode bit 1, 0 (pc10md1, pc10md0) 1 atu one-shot pulse output (tod10) atu one-shot pulse output (tod10) 1 0 reserved reserved 1 reserved reserved 3, 2 0 0 generic input/output (pc9) (initial value) generic input/output (pc9) (initial value) pc9 mode bit 1, 0 (pc9md1, pc9md0) 1 atu one-shot pulse output (toc10) atu one-shot pulse output (toc10) 1 0 reserved reserved 1 reserved reserved 1, 0 0 0 generic input/output (pc8) (initial value) generic input/output (pc8) (initial value) pc8 mode bit 1, 0 (pc8md1, pc8md0) 1 atu one-shot pulse output (tob10) atu one-shot pulse output (tob10) 1 0 reserved reserved 1 reserved reserved
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 757 of 818 rej09b0273-0500 pccr2 bit: 15 14 13 12 11 10 9 8 bit name: pc7md1 pc7md0 pc6md1 pc6md0 ? pc5md ? pc4md initial value:00001011 r/w: r/w r/w r/w r/w r r/w r r/w bit:76543210 bit name: ? pc3md ? pc2md ? pc1md ? pc0md initial value:11111111 r/w:rr/wrr/wrr/wrr/w pin function bit bit name value expanded mode single-chip mode 15, 14 0 0 generic input/output (pc7) (initial value) generic input/output (pc7) (initial value) pc7 mode bit 1, 0 (pc7md1, pc7md0) 1 atu one-shot pulse output (toa10) atu one-shot pulse output (toa10) 1 0 reserved reserved 1 reserved reserved 13, 12 0 0 generic input/output (pc6) (initial value) generic input/output (pc6) (initial value) pc6 mode bit 1, 0 (pc6md1, pc6md0) 1 chip select output ( cs2 ) generic input/output (pc6) 1 0 interrupt request input ( irq6 ) interrupt request input ( irq6 ) 1 a/d conversion end output (adend) a/d conversion end output (adend) 10 pc5 mode bit (pc5md) 0 generic input/output (pc5) (initial value) generic input/output (pc5) (initial value) 1 chip select output ( cs1 ) generic input/output (pc5) 8 0 generic input/output (pc4) generic input/output (pc4) pc4 mode bit (pc4md) 1 chip select output ( cs0 ) (initial value) generic input/output (pc4) (initial value) 6 0 generic input/output (pc3) generic input/output (pc3) pc3 mode bit 1 (pc3md) 1 read output ( rd ) (initial value) generic input/output (pc3) (initial value)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 758 of 818 rej09b0273-0500 pin function bit bit name value expanded mode single-chip mode 4 0 generic input/output (pc2) generic input/output (pc2) pc2 mode bit (pc2md) 1 wait state input ( wait ) (initial value) generic input/output (pc2) (initial value) 2 0 generic input/output (pc1) generic input/output (pc1) pc1 mode bit (pc1md) 1 upper write ( wrh ) (initial value) generic input/output (pc1) (initial value) 0 0 generic input/output (pc0) generic input/output (pc0) pc0 mode bit (pc0md) 1 lower write ( wrl ) (initial value) generic input/output (pc0) (initial value)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 759 of 818 rej09b0273-0500 port d data register (pddr) h'ffff8398 8/16 port d bit: 15 14 13 12 11 10 9 8 bit name: pd15dr pd14dr pd13dr pd12dr pd11dr pd10dr pd9dr pd8dr initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pd7dr pd6dr pd5dr pd4dr pd3dr pd2dr pd1dr pd0dr initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit value pin function read write 15 ? 0 0 generic input pin state pddr can be written to, but the pin state is not affected other than generic input pin state pddr can be written to, but the pin state is not affected 1 generic output pddr value write value is output at the pin ( pod pin is high) high-impedance regardless of pddr value ( pod pin is low) other than generic output pddr value pddr can be written to, but the pin state is not affected
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 760 of 818 rej09b0273-0500 port d io register (pdior) h'ffff839a 8/16 port d bit: 15 14 13 12 11 10 9 8 bit name: pd15ior pd14ior pd13ior pd12ior pd11ior pd10ior pd9ior pd8ior initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pd7ior pd6ior pd5ior pd4ior pd3ior pd2ior pd1ior pd0ior initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 ? 0 0 input (initial value) port d io register (pd15ior to pd0ior) 1 output
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 761 of 818 rej09b0273-0500 port d control register (pdcr) h'ffff839c 8/16 port d bit: 15 14 13 12 11 10 9 8 bit name: pd15md pd14md pd13md pd12md pd11md pd10md pd9md pd8md initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pd7md pd6md pd5md pd4md pd3md pd2md pd1md pd0md initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w pin function bit bit name value expanded mode with rom disabled area 0: 8 bits expanded mode with rom disabled area 0: 16 bits expanded mode with rom enabled single-chip mode 15 pd15 mode bit (pd15md) 0 generic input/output (pd15) (initial value) data input/output (d15) (initial value) generic input/output (pd15) (initial value) generic input/output (pd15) (initial value) 1 data input/output (d15) data input/output (d15) data input/output (d15) generic input/output (pd15) 14 pd14 mode bit (pd14md) 0 generic input/output (pd14) (initial value) data input/output (d14) (initial value) generic input/output (pd14) (initial value) generic input/output (pd14) (initial value) 1 data input/output (d14) data input/output (d14) data input/output (d14) generic input/output (pd14) 13 pd13 mode bit (pd13md) 0 generic input/output (pd13) (initial value) data input/output (d13) (initial value) generic input/output (pd13) (initial value) generic input/output (pd13) (initial value) 1 data input/output (d13) data input/output (d13) data input/output (d13) generic input/output (pd13) 12 pd12 mode bit (pd12md) 0 generic input/output (pd12) (initial value) data input/output (d12) (initial value) generic input/output (pd12) (initial value) generic input/output (pd12) (initial value) 1 data input/output (d12) data input/output (d12) data input/output (d12) generic input/output (pd12) 11 pd11 mode bit (pd11md) 0 generic input/output (pd11) (initial value) data input/output (d11) (initial value) generic input/output (pd11) (initial value) generic input/output (pd11) (initial value) 1 data input/output (d11) data input/output (d11) data input/output (d11) generic input/output (pd11) 10 pd10 mode bit (pd10md) 0 generic input/output (pd10) (initial value) data input/output (d10) (initial value) generic input/output (pd10) (initial value) generic input/output (pd10) (initial value) 1 data input/output (d10) data input/output (d10) data input/output (d10) generic input/output (pd10) 9pd9 mode bit (pd9md) 0 generic input/output (pd9) (initial value) data input/output (d9) (initial value) generic input/output (pd9) (initial value) generic input/output (pd9) (initial value) 1 data input/output (d9) data input/output (d9) data input/output (d9) generic input/output (pd9)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 762 of 818 rej09b0273-0500 pin function bit bit name value expanded mode with rom disabled area 0: 8 bits expanded mode with rom disabled area 0: 16 bits expanded mode with rom enabled single-chip mode 8pd8 mode bit (pd8md) 0 generic input/output (pd8) (initial value) data input/output (d8) (initial value) generic input/output (pd8) (initial value) generic input/output (pd8) (initial value) 1 data input/output (d8) data input/output (d8) data input/output (d8) generic input/output (pd8) expanded mode with rom disabled expanded mode with rom enabled single-chip mode 7 pd7 mode bit (pd7md) 0 data input/output (d7) (initial value) generic input/output (pd7) (initial value) generic input/output (pd7) (initial value) 1 data input/output (d7) data input/output (d7) generic input/output (pd7) 6 pd6mode bit (pd6md) 0 data input/output (d6) (initial value) generic input/output (pd6) (initial value) generic input/output (pd6) (initial value) 1 data input/output (d6) data input/output (d6) generic input/output (pd6) 5 pd5 mode bit (pd5md) 0 data input/output (d5) (initial value) generic input/output (pd5) (initial value) generic input/output (pd5) (initial value) 1 data input/output (d5) data input/output (d5) generic input/output (pd5) 4pd4 mode bit (pd4md) 0 data input/output (d4) (initial value) generic input/output (pd4) (initial value) generic input/output (pd4) (initial value) 1 data input/output (d4) data input/output (d4) generic input/output (pd4) 3 pd3 mode bit (pd3md) 0 data input/output (d3) (initial value) generic input/output (pd3) (initial value) generic input/output (pd3) (initial value) 1 data input/output (d3) data input/output (d3) generic input/output (pd3) 2pd2 mode bit (pd2md) 0 data input/output (d2) (initial value) generic input/output (pd2) (initial value) generic input/output (pd2) (initial value) 1 data input/output (d2) data input/output (d2) generic input/output (pd2) 1 pd1 mode bit (pd1md) 0 data input/output (d1) (initial value) generic input/output (pd1) (initial value) generic input/output (pd1) (initial value) 1 data input/output (d1) data input/output (d1) generic input/output (pd1) 0pd0 mode bit (pd0md) 0 data input/output (d0) (initial value) generic input/output (pd0) (initial value) generic input/output (pd0) (initial value) 1 data input/output (d0) data input/output (d0) generic input/output (pd0)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 763 of 818 rej09b0273-0500 port control register (ckcr) h'ffff839e 8/16 port bit: 15 14 13 12 11 10 9 8 bit name: ???????? initial value:11111111 r/w:rrrrrrrr bit:76543210 bit name: ??????? cklo initial value:11111110 r/w:rrrrrrrr/w bit bit name value description 0 cklo 0 selects the internal clock for the ck terminal output (initial value) 1 always selects the low level for the ck terminal output
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 764 of 818 rej09b0273-0500 port e data register (pedr) h'ffff83a0 8/16 port e bit: 15 14 13 12 11 10 9 8 bit name: ? pe14dr pe13dr pe12dr pe11dr pe10dr pe9dr pe8dr initial value:10000000 r/w: r r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pe7dr pe6dr pe5dr pe4dr pe3dr pe2dr pe1dr pe0dr initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit value pin function read write 14 ? 0 0 generic input pin state pedr can be written to, but the pin state is not affected other than generic input pin state pedr can be written to, but the pin state is not affected 1 generic output pedr value write value is output at the pin other than generic output pedr value pedr can be written to, but the pin state is not affected
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 765 of 818 rej09b0273-0500 port e io register (peior) h'ffff83a2 8/16 port e bit: 15 14 13 12 11 10 9 8 bit name: ? pe14ior pe13ior pe12ior pe11ior pe10ior pe9ior pe8ior initial value:10000000 r/w: r r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pe7ior pe6ior pe5ior pe4ior pe3ior pe2ior pe1ior pe0ior initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 14 ? 0 0 input (initial value) port e io register (pe14ior to pe0ior) 1 output
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 766 of 818 rej09b0273-0500 port e control register (pecr) h'ffff83a4 8/16 port e bit: 15 14 13 12 11 10 9 8 bit name: ? pe14md pe13md pe12md pe11md pe10md pe9md pe8md initial value:10000000 r/w: r r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pe7md pe6md pe5md pe4md pe3md pe2md pe1md pe0md initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value pin function 14 0 generic input/output (pe14) (initial value) pe14 mode bit (pe14md) 1 atu input capture input/output compare output (tioc3) 13 0 generic input/output (pe13) (initial value) pe13 mode bit (pe13md) 1 atu input capture input/output compare output (tiob3) 12 0 generic input/output (pe12) (initial value) pe12 mode bit (pe12md) 1 atu input capture input/output compare output (tioa3) 11 0 generic input/output (pe11) (initial value) pe11 mode bit (pe11md) 1 atu input capture input (tid0) 10 0 generic input/output (pe10) (initial value) pe10 mode bit (pe10md) 1 atu input capture input (tic0) 9 0 generic input/output (pe9) (initial value) pe9 mode bit (pe9md) 1 atu input capture input (tib0) 8 0 generic input/output (pe8) (initial value) pe8 mode bit (pe8md) 1 atu input capture input (tia0) 7 0 generic input/output (pe7) (initial value) pe7 mode bit (pe7md) 1 atu input capture input/output compare output (tiob2) 6 0 generic input/output (pe6) (initial value) pe6 mode bit (pe6md) 1 atu input capture input/output compare output (tioa2) 5 0 generic input/output (pe5) (initial value) pe5 mode bit (pe5md) 1 atu input capture input/output compare output (tiof1)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 767 of 818 rej09b0273-0500 bit bit name value pin function 4 0 generic input/output (pe4) (initial value) pe4 mode bit (pe4md) 1 atu input capture input/output compare output (tioe1) 3 0 generic input/output (pe3) (initial value) pe3 mode bit (pe3md) 1 atu input capture input/output compare output (tiod1) 2 0 generic input/output (pe2) (initial value) pe2 mode bit (pe2md) 1 atu input capture input/output compare output (tioc1) 1 0 generic input/output (pe1) (initial value) pe1 mode bit (pe1md) 1 atu input capture input/output compare output (tiob1) 0 0 generic input/output (pe0) (initial value) pe0 mode bit (pe0md) 1 atu input capture input/output compare output (tioa1)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 768 of 818 rej09b0273-0500 port f data register (pfdr) h'ffff83a6 8/16 port f bit: 15 14 13 12 11 10 9 8 bit name: ???? pf11dr pf10dr pf9dr pf8dr initial value:11110000 r/w:rrrrr/wr/wr/wr/w bit:76543210 bit name: pf7dr pf6dr pf5dr pf4dr pf3dr pf2dr pf1dr pf0dr initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit value pin function read write 11 ? 0 0 generic input pin state pfdr can be written to, but the pin state is not affected other than generic input pin state pfdr can be written to, but the pin state is not affected 1 generic output pfdr value write value is output at the pin other than generic output pfdr value pfdr can be written to, but the pin state is not affected
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 769 of 818 rej09b0273-0500 port f io register (pfior) h'ffff83a8 8/16 port f bit: 15 14 13 12 11 10 9 8 bit name: ???? pf11ior pf10ior pf9ior pf8ior initial value:11110000 r/w:rrrrr/wr/wr/wr/w bit:76543210 bit name: pf7ior pf6ior pf5ior pf4ior pf3ior pf2ior pf1ior pf0ior initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 11 ? 0 0 input (initial value) port f io register (pf11ior to pf0ior) 1 output
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 770 of 818 rej09b0273-0500 h'ffff83aa (pfcr1) 8/16 port f port f control registers 1 and 2 (pfcr1, pfcr2) h'ffff83ac (pfcr2) pfcr1 bit: 15 14 13 12 11 10 9 8 bit name: ???????? initial value:11111111 r/w:rrrrrrrr bit:76543210 bit name: pf11md1 pf11md0 pf10md1 pf10md0 pf9md1 pf9md0 pf8md1 pf8md0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w pin function bit bit name value expanded mode single-chip mode 7, 6 pf11 mode bit 1, 0 (pf11md1, pf11md0) 0 0 generic input/output (pf11) (initial value) generic input/output (pf11) (initial value) 1 bus request input ( breq ) generic input/output (pf11) 1 0 apc pulse output (puls7) apc pulse output (puls7) 1 reserved reserved 5, 4 pf10 mode bit 1, 0 (pf10md1, pf10md0) 0 0 generic input/output (pf10) (initial value) generic input/output (pf10) (initial value) 1 bus request acknowledge output ( back ) generic input/output (pf10) 1 0 apc pulse output (puls6) apc pulse output (puls6) 1 reserved reserved 3, 2 pf9 mode bit 1, 0 (pf9md1, pf9md0) 0 0 generic input/output (pf9) (initial value) generic input/output (pf9) (initial value) 1 chip select output ( cs3 ) generic input/output (pf9) 1 0 interrupt request input ( irq7 ) interrupt request input ( irq7 ) 1 apc pulse output (puls5) apc pulse output (puls5) 1, 0 pf8 mode bit 1, 0 (pf8md1, pf8md0) 0 0 generic input/output (pf8) (initial value) generic input/output (pf8) (initial value) 1 serial clock input/output (sck2) serial clock input/output (sck2) 1 0 apc pulse output (puls4) apc pulse output (puls4) 1 reserved reserved
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 771 of 818 rej09b0273-0500 pfcr2 bit: 15 14 13 12 11 10 9 8 bit name: pf7md1 pf7md0 pf6md1 pf6md0 pf5md1 pf5md0 pf4md1 pf4md0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: ? pf3md ? pf2md ? pf1md ? pf0md initial value:10101010 r/w:rr/wrr/wrr/wrr/w pin function bit bit name value expanded mode single-chip mode 15, 14 pf7 mode bit 1, 0 (pf7md1, pf7md0) 0 0 generic input/output (pf7) (initial value) generic input/output (pf7) (initial value) 1 dma transfer request input ( dreq0 ) dma transfer request input ( dreq0 ) 1 0 apc pulse output (puls3) apc pulse output (puls3) 1 reserved reserved 13, 12 pf6 mode bit 1, 0 (pf6md1, pf6md0) 0 0 generic input/output (pf6) (initial value) generic input/output (pf6) 1 dma transfer request acknowledge output (dack0) generic input/output (pf6) 1 0 apc pulse output (puls2) apc pulse output (puls2) 1 reserved reserved 11, 10 pf5 mode bit 1, 0 (pf5md1, pf5md0) 0 0 generic input/output (pf5) (initial value) generic input/output (pf5) (initial value) 1 dma transfer request input ( dreq1 ) dma transfer request input ( dreq1 ) 1 0 apc pulse output (puls1) apc pulse output (puls1) 1 reserved reserved 9, 8 pf4 mode bit 1, 0 (pf4md1, pf4md0) 0 0 generic input/output (pf4) (initial value) generic input/output (pf4) 1 dma transfer request acknowledge output (dack1) generic input/output (pf4) 1 0 apc pulse output (puls0) apc pulse output (puls0) 1 reserved reserved
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 772 of 818 rej09b0273-0500 pin function bit bit name value expanded mode single-chip mode 6 pf3 mode bit (pf3md) 0 generic input/output (pf3) (initial value) generic input/output (pf3) (initial value) 1 interrupt request input ( irq3 ) interrupt request input ( irq3 ) 4 pf2 mode bit (pf2md) 0 generic input/output (pf2) (initial value) generic input/output (pf2) (initial value) 1 interrupt request input ( irq2 ) interrupt request input ( irq2 ) 2 pf1 mode bit (pf1md) 0 generic input/output (pf1) (initial value) generic input/output (pf1) (initial value) 1 interrupt request input ( irq1 ) interrupt request input ( irq1 ) 0 pf0 mode bit (pf0md) 0 generic input/output (pf0) (initial value) generic input/output (pf0) (initial value) 1 interrupt request input ( irq0 ) interrupt request input ( irq0 )
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 773 of 818 rej09b0273-0500 port g data register (pgdr) h'ffff83ae 8/16 port g bit: 15 14 13 12 11 10 9 8 bit name: pg15dr pg14dr pg13dr pg12dr pg11dr pg10dr pg9dr pg8dr initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pg7dr pg6dr pg5dr pg4dr pg3dr pg2dr pg1dr pg0dr initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit value pin function read write 15 ? 0 0 generic input pin state pgdr can be written to, but the pin state is not affected other than generic input pin state pgdr can be written to, but the pin state is not affected 1 generic output pgdr value write value is output at the pin other than generic output pgdr value pgdr can be written to, but the pin state is not affected
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 774 of 818 rej09b0273-0500 port g io register (pgior) h'ffff83b0 8/16 port g bit: 15 14 13 12 11 10 9 8 bit name: pg15iorpg14iorpg13iorpg12iorpg11iorpg10ior pg9ior pg8ior initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: pg7ior pg6ior pg5ior pg4ior pg3ior pg2ior pg1ior pg0ior initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 ? 0 0 input (initial value) port g io register (pg15ior to pg0ior) 1 output
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 775 of 818 rej09b0273-0500 h'ffff83b2 (pgcr1) 8/16 port g port g control registers 1 and 2 (pgcr1, pgcr2) h'ffff83b4 (pgcr2) pgcr1 bit: 15 14 13 12 11 10 9 8 bit name: pg15md1 pg15md0 pg14md1 pg14md0 ? pg13md ? pg12md initial value:00001010 r/w: r/w r/w r/w r/w r r/w r r/w bit:76543210 bit name: ? pg11md ? pg10md ? pg9md ? pg8md initial value:10101010 r/w:rr/wrr/wrr/wrr/w bit bit name value pin function 15, 14 0 0 generic input/output (pg15) (initial value) pg15 mode bit 1, 0 (pg15md1, pg15md0) 1 interrupt request input ( irq5 ) 1 0 atu input capture input/output compare output (tiob5) 1 reserved 13, 12 0 0 generic input/output (pg14) (initial value) pg14 mode bit 1, 0 (pg14md1, pg14md0) 1 interrupt request input ( irq4 ) 1 0 atu input capture input/output compare output (tioa5) 1 reserved 10 0 generic input/output (pg13) (initial value) pg13 mode bit (pg13md) 1 atu input capture input/output compare output (tiod4) 8 0 generic input/output (pg12) (initial value) pg12 mode bit (pg12md) 1 atu input capture input/output compare output (tioc4) 6 0 generic input/output (pg11) (initial value) pg11 mode bit (pg11md) 1 atu input capture input/output compare output (tiob4) 4 0 generic input/output (pg10) (initial value) pg10 mode bit (pg10md) 1 atu input capture input/output compare output (tioa4) 2 0 generic input/output (pg9) (initial value) pg9 mode bit (pg9md) 1 atu input capture input/output compare output (tiod3) 0 0 generic input/output (pg8) (initial value) pg8 mode bit (pg8md) 1 receive data input (rxd2)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 776 of 818 rej09b0273-0500 pgcr2 bit: 15 14 13 12 11 10 9 8 bit name: ? pg7md ? pg6md ? pg5md ? pg4md initial value:10101010 r/w:rr/wrr/wrr/wrr/w bit:76543210 bit name: ? pg3md pg2md pg1md pg0md1 pg0md0 irqmd1 irqmd0 initial value:10000000 r/w: r r/w r/w r/w r/w r/w r/w r/w bit bit name value pin function 14 pg7 mode bit (pg7md) 0 generic input/output (pg7) (initial value) 1 transmit data output (txd2) 12 pg6 mode bit (pg6md) 0 generic input/output (pg6) (initial value) 1 receive data output (rxd1) 10 pg5 mode bit (pg5md) 0 generic input/output (pg5) (initial value) 1 transmit data output (txd1) 8 pg4 mode bit (pg4md) 0 generic input/output (pg4) (initial value) 1 serial clock input/output (sck1) 6 pg3 mode bit (pg3md) 0 generic input/output (pg3) (initial value) 1 receive data output (rxd0) 5 pg2 mode bit (pg2md) 0 generic input/output (pg2) (initial value) 1 transmit data output (txd0) 4 pg1 mode bit (pg1md) 0 generic input/output (pg1) (initial value) 1 serial clock input/output (sck0) 3, 2 0 0 generic input/output (pg0) (initial value) pg0 mode bit 1, 0 (pg0md1, pg0md0) 1 a/d conversion trigger input (adtrg) 1 0 interrupt request output ( irqout ) 1 reserved 1, 0 0 0 irqout is always high irqout mode bit 1, 0 (irqmd1, irqmd0) 1 output on intc interrupt request 1 0 output on refresh request 1 output on intc interrupt request and refresh request
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 777 of 818 rej09b0273-0500 port h data register (phdr) h'ffff83b6 8/16 port h bit: 15 14 13 12 11 10 9 8 bit name: ph15dr ph14dr ph13dr ph12dr ph11dr ph10dr ph9dr ph8dr initial value: ???????? r/w:rrrrrrrr bit:76543210 bit name: ph7dr ph6dr ph5dr ph4dr ph3dr ph2dr ph1dr ph0dr initial value: ???????? r/w:rrrrrrrr pin input/output pin function read write input generic pin state is read ignored (pin state is not affected) ann 1 is read ignored (pin state is not affected) n = 0 ? 15 a/d trigger register (adtrgr) h'ffff83b8 8 a/d bit:76543210 bit name: extrg ??????? initial value:11111111 r/w:r/wrrrrrrr bit bit name value description 7 trigger enable (extrg) 0 a/d conversion is triggered by the atu channel 0 interval timer interrupt 1 a/d conversion is triggered by external pin input (adtrg) (initial value)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 778 of 818 rej09b0273-0500 pulse output port control register (popcr) h'ffff83c0 8/16 apc bit: 15 14 13 12 11 10 9 8 bit name: puls7 puls6 puls5 puls4 puls3 puls2 puls1 puls0 roe roe roe roe roe roe roe roe initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: puls7 puls6 puls5 puls4 puls3 puls2 puls1 puls0 soe soe soe soe soe soe soe soe initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 ? 8 0 0 output to apc pulse output pin (puls7 ? puls0) is disabled (initial value) puls7 to puls0 reset output enable (puls7roe to puls0roe) 1 0 output to apc pulse output pin (puls7 ? puls0) is enabled 7 ? 0 0 1 output to apc pulse output pin (puls7 ? puls0) is disabled (initial value) puls7 to puls0 set output enable (puls7soe to puls0soe) 1 1 output to apc pulse output pin (puls7 ? puls0) is enabled
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 779 of 818 rej09b0273-0500 system control register (syscr) h'ffff83c8 8 power-down state bit:76543210 bit name: ??????? rame initial value:00000001 r/w:rrrrrrrr/w bit bit name value description 0 ram enable (rame) 0 on-chip ram disabled 1 on-chip ram enabled (initial value) compare match timer start register (cmstr) h'ffff83d0 (all channels) 8/16/32 cmt bit: 15 14 13 12 11 10 9 8 bit name: ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 bit name: ?????? str1 str0 initial value:00000000 r/w:rrrrrrr/wr/w bit bit name value description 1 count start 1 (str1) 0 cmcnt1 halted (initial value) 1 cmcnt1 counts 0 count start 0 (str0) 0 cmcnt0 halted (initial value) 1 cmcnt0 counts
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 780 of 818 rej09b0273-0500 compare match timer control/ status register (cmcsr) h'ffff83d2 (channel 0) h'ffff83d8 (channel 1) 8/16/32 cmt bit: 15 14 13 12 11 10 9 8 bit name: ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 bit name: cmf cmie ???? cks1 cks0 initial value:00000000 r/w: r/(w) * r/w ???? r/w r/w note: * only 0 can be written, to clear the flag. bit bit name value description 7 compare match flag (cmf) 0 cmcnt and cmcor values do not match (initial value) [clearing condition] read cmf when cmf =1, then write 0 in cmf 1 cmcnt and cmcor values match 6 compare match interrupt enable (cmie) 0 compare match interrupt (cmi) disabled (initial value) 1 compare match interrupt (cmi) enabled 1, 0 0 0 /8 (initial value) clock select 1 and 0 (cks1, cks0) 1 /32 10 /128 1 /512
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 781 of 818 rej09b0273-0500 compare match timer counter (cmcnt) h'ffff83d4 (channel 0) h'ffff83da (channel 1) 8/16/32 cmt bit:1514131211109876543210 bit name: initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 (count value) input clock count value compare match timer constant register (cmcor) h'ffff83d6 (channel 0) h'ffff83dc (channel 1) 8/16/32 cmt bit:1514131211109876543210 bit name: initial value:1111111111111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 (compare match cycle) set with compare match cycle
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 782 of 818 rej09b0273-0500 flash memory control register 1 (flmcr1) h'ffff8580 8 flash memory bit:76543210 bit name: fwe swe esu psu ev pv e p initial value:1/00000000 r/w: r r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7 flash write enable (fwe) 0 low-level input at fwe pin (hardware protect state) 1 high-level input at fwe pin 6 0 writes disabled (initial value) software write enable (swe) 1 writes enabled [setting condition] fwe = 1 5 erase setup (esu) 0 erase setup released (initial value) 1 erase setup 4 program setup (psu) 0 program setup released (initial value) 1 program setup 3 erase-verify (ev) 0 exit from erase-verify mode (initial value) 1 transition to erase-verify mode 2 program-verify (pv) 0 exit from program-verify mode (initial value) 1 transition to program-verify mode 1 erase (e) 0 exit from erase mode (initial value) 1 transition to erase mode 0 program (p) 0 exit from program mode (initial value) 1 transition to program mode
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 783 of 818 rej09b0273-0500 flash memory control register 2 (flmcr2) h'ffff8581 8 flash memory bit:76543210 bit name: fler ??????? initial value:00000000 r/w:rrrrrrrr bit bit name value description 7 flash memory error (fler) 0 flash memory operates normally (initial value) flash memory is not write/erase-protected (is not in error protect mode) [clearing condition] reset or transition to hardware standby mode 1 error occurred during flash memory write/erase flash memory is write/erase-protected (is in error protect mode) [setting condition] see error protect mode erase block register 1 (ebr1) h'ffff8582 8 flash memory bit:76543210 bit name: eb7 eb6 eb5 eb4 eb3 eb2 eb1 eb0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 7 ? 0 (block specification) specifies flash memory erase area, block by block
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 784 of 818 rej09b0273-0500 h'ffff85d0 8/16 a/d a/d data registers 0(h/l) to 15(h/l) (addr0(h/l) to addr15(h/l)) h'ffff85d2 h'ffff85d4 h'ffff85d6 h'ffff85d8 h'ffff85da h'ffff85dc h'ffff85de h'ffff85e0 h'ffff85e2 h'ffff85e4 h'ffff85e6 h'ffff85f0 h'ffff85f2 h'ffff85f4 h'ffff85f6 bit: 15 14 13 12 11 10 9 8 bit name: ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 initial value:00000000 r/w:rrrrrrrr bit:76543210 bit name: ad1 ad0 ?????? initial value:00000000 r/w:rrrrrrrr bit bit name description 15 ? 8 a/d data register 9 to 2 upper 8 bits of a/d conversion result 7, 6 a/d data register 1 and 0 lower 2 bits of a/d conversion result
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 785 of 818 rej09b0273-0500 a/d control/status register 0 (adcsr0) h'ffff85e8 8/16 a/d bit:76543210 bit name: adf adie adm1 adm0 ch3 ch2 ch1 ch0 initial value:00000000 r/w: r/(w) * r/w r/w r/w r/w r/w r/w r/w note: * only 0 can be written to clear the flag. bit bit name value description 7 a/d end flag (adf) 0 a/d0 executing a/d conversion or in idle state (initial value) [clearing conditions] 1. read adf when adf =1, then write 0 in adf 2. dmac activated by adi0 interrupt 1 a/d0 has ended a/d conversion and digital value has been transferred to addr [setting conditions] 1. single mode: a/d conversion ends 2. scan mode: all a/d conversion ends within one selected analog group 6 0 adi0 a/d interrupt is disabled (initial value) a/d interrupt enable (adie) 1 adi0 a/d interrupt is enabled 5, 4 0 0 single mode a/d mode 1 and 0 (adm1, adm0) 1 4-channel scan mode (analog group 0/group 1/group 2) 1 0 8-channel scan mode (analog groups 0 and 1) 1 12-channel scan mode (analog groups 0, 1, and 2) 3, 2, analog input channels 1, 0 channel select 3 to 0 (ch3 to ch0) single mode 4-channel scan mode 8-channel scan mode 12-channel scan mode 0000an0 (initial value) an0 an0, 4 an0, 4, 8 1 an1 an0, 1 an0, 1, 4, 5 an0, 1, 4, 5, 8, 9 10an2 an0 ? 2an0 ? 2, 4 ? 6an0 ? 2, 4 ? 6, 8 ? 10 1an3 an0 ? 3an0 ? 7an0 ? 11 100an4 an4 an0, 4 an0, 4, 8 1 an5 an4, 5 an0, 1, 4, 5 an0, 1, 4, 5, 8, 9 10an6 an4 ? 6an0 ? 2, 4 ? 6an0 ? 2, 4 ? 6, 8 ? 10 1an7 an4 ? 7an0 ? 7an0 ? 11 10 * 1 00an8 an8 reserved * 2 an0, 4, 8 1 an9 an8, 9 an0, 1, 4, 5, 8, 9 1 0 an10 an8 ? 10 an0 ? 2, 4 ? 6, 8 ? 10 1 an11 an8 ? 11 an0 ? 11 notes: 1. must be cleared to 0. 2. reserved for future expansion. do not use these settings.
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 786 of 818 rej09b0273-0500 a/d control register 0 (adcr0) h'ffff85e9 8/16 a/d bit:76543210 bit name: trge cks adst ????? initial value:00011111 r/w:r/wr/wr/wrrrrr bit bit name value description 7 trigger enable (trge) 0 starting of a/d conversion by external trigger or atu trigger is disabled (initial value) 1 starting of a/d conversion by external trigger or atu trigger is enabled 6 clock select (cks) 0 conversion time = 266 states (maximum) (initial value) 1 conversion time = 134 states (maximum) 5 a/d start (adst) 0 a/d conversion is stopped (initial value) 1 a/d conversion is in progress [clearing conditions] 1. single mode: adst is cleared automatically when a/d conversion ends 2. scan mode: confirm that adf in adcsr0 is 1, then write 0 in adst
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 787 of 818 rej09b0273-0500 a/d control/status register 1 (adcsr1) h'ffff85f8 8/16 a/d bit:76543210 bit name: adf adie adst scan cks ? ch1 ch0 initial value:00000000 r/w: r/(w) * r/w r/w r/w r/w r r/w r/w note: * only 0 can be written to clear the flag. bit bit name value description 7 a/d end flag (adf) 0 a/d1 executing a/d conversion or in idle state (initial value) [clearing conditions] 1. read adf when adf =1, then write 0 in adf 2. dmac activated by adi1 interrupt 1 a/d1 has ended a/d conversion and digital value has been transferred to addr [setting conditions] 1. single mode: a/d conversion ends 2. scan mode: all a/d conversion ends within one selected analog group 6 0 adi1 a/d interrupt is disabled (initial value) a/d interrupt enable (adie) 1 adi1 a/d interrupt is enabled 5 a/d start (adst) 0 a/d conversion is stopped (initial value) 1 a/d conversion is in progress [clearing conditions] 1. single mode: adst is cleared automatically when a/d conversion ends 2. scan mode: confirm that adf in adcsr1 is 1, then write 0 in adst 4 scan mode (scan) 0 single mode (initial value) 1 scan mode 3 clock select (cks) 0 conversion time = 266 states (maximum) (initial value) 1 conversion time = 134 states (maximum) analog input channels single mode scan mode 1, 0 0 0 an12 (initial value) an12 channel select 1 and 0 (ch1, ch0) 1 an13 an12, 13 10 an14 an12 ? 14 1 an15 an12 ? 15
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 788 of 818 rej09b0273-0500 a/d control register 1 (adcr1) h'ffff85f9 8/16 a/d bit:76543210 bit name: trge ??????? initial value:01111111 r/w:r/wrrrrrrr bit bit name value description 7 trigger enable (trge) 0 starting of a/d conversion by external trigger or atu trigger is disabled (initial value) 1 starting of a/d conversion by external trigger or atu trigger is enabled user break address register h (ubarh) h'ffff8600 8/16/32 ubc bit: 15 14 13 12 11 10 9 8 bit name: uba31 uba30 uba29 uba28 uba27 uba26 uba25 uba24 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: uba23 uba22 uba21 uba20 uba19 uba18 uba17 uba16 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 user break address 31 to 16 (uba31 to uba16) upper half (bits 31 to 16) of the address taken as the break condition
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 789 of 818 rej09b0273-0500 user break address register l (ubarl) h'ffff8602 8/16/32 ubc bit: 15 14 13 12 11 10 9 8 bit name: uba15 uba14 uba13 uba12 uba11 uba10 uba9 uba8 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: uba7 uba6 uba5 uba4 uba3 uba2 uba1 uba0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 user break address 15 to 0 (uba15 to uba0) lower half (bits 15 to 0) of the address taken as the break condition user break address mask register h (ubamrh) h'ffff8604 8/16/32 ubc bit: 15 14 13 12 11 10 9 8 bit name: ubm31 ubm30 ubm29 ubm28 ubm27 ubm26 ubm25 ubm24 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: ubm23 ubm22 ubm21 ubm20 ubm19 ubm18 ubm17 ubm16 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 user break address mask 31 to 16 (ubm31 to ubm16) specifies bits to be masked in break address set in ubarh
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 790 of 818 rej09b0273-0500 user break address mask register l (ubamrl) h'ffff8606 8/16/32 ubc bit: 15 14 13 12 11 10 9 8 bit name: ubm15 ubm14 ubm13 ubm12 ubm11 ubm10 ubm9 ubm8 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: ubm7 ubm6 ubm5 ubm4 ubm3 ubm2 ubm1 ubm0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 15 ? 0 user break address mask 15 to 0 (ubm15 to ubm0) specifies bits to be masked in break address set in ubarl
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 791 of 818 rej09b0273-0500 user break bus cycle register (ubbr) h'ffff8608 8/16/32 ubc bit: 15 14 13 12 11 10 9 8 bit name: ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 bit name: cp1 cp0 id1 id0 rw1 rw0 sz1 sz0 initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 7, 6 0 0 user break interrupt not generated (initial value) 1 cpu cycle taken as the break condition 1 0 peripheral cycle taken as the break condition cpu cycle/peripheral cycle select (cp1, cp0) 1 cpu cycle and peripheral cycle both taken as break conditions 5, 4 0 0 user break interrupt not generated (initial value) 1 instruction fetch cycle taken as the break condition instruction fetch/data access select (id1, id0) 1 0 data access cycle taken as the break condition 1 instruction fetch cycle and data access cycle both taken as break conditions 3, 2 0 0 user break interrupt not generated (initial value) read/write select (rw1, rw0) 1 read cycle taken as the break condition 1 0 write cycle taken as the break condition 1 read and write cycles both taken as break conditions 1, 0 operand size select (sz1, sz0) 0 0 operand size not included in the break condition (initial value) 1 byte access taken as the break condition 1 0 word access taken as the break condition 1 longword access taken as the break condition
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 792 of 818 rej09b0273-0500 timer control/status register (tcsr) h'ffff8610 8 wdt bit:76543210 bit name: ovf wt/i t tme ?? cks2 cks1 cks0 initial value:00011000 r/w: r/(w) * r/w r/w r r r/w r/w r/w note: * to prevent tcsr from being modified easily, the write method differs from that used for general registers. for details, see section 12.2.4, register access. bit bit name value description 7 overflow flag (ovf) 0 no tcnt overflow in interval timer mode (initial value) [clearing condition] read ovf, then write 0 in ovf 1 tcnt overflow in interval timer mode 6 timer mode select (wt/ it ) 0 interval timer mode: interval timer interrupt (iti) request sent to cpu when tcnt overflows (initial value) 1 watchdog timer mode: wdtovf signal output externally when tcnt overflows 5 timer enable (tme) 0 timer disabled: tcnt is initialized to h'00 and halted (initial value) 1 timer enabled: tcnt starts counting wdtovf signal or interrupt generated when tcnt overflows clock overflow interval * (when = 20 mhz) 2 ? 0000 /2 (initial value) 25.6 s clock select 2 to 0 (cks2 to cks0) 1 /64 819.2 s 10 /128 1.6 ms 1 /256 3.3 ms 100 /512 6.6 ms 1 /1024 13.1 ms 10 /4096 52.4 ms 1 /8192 104.9 ms note: * the overflow interval listed is the time from when the tcnt begins counting at h'00 until an overflow occurs.
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 793 of 818 rej09b0273-0500 timer counter (tcnt) h'ffff8611 8 wdt bit:76543210 bit name: initial value:00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 7 ? 0 (count value) input count clock value reset control/status register (rstcsr) h'ffff8613 8 wdt bit:76543210 bit name: wovf rste ?????? initial value:00001111 r/w: r/(w) * r/wrrrrrr note: * only 0 can be written in bit 7 to clear the flag. bit bit name value description 7 watchdog timer overflow flag (wovf) 0 no tcnt overflow in watchdog timer mode (initial value) [clearing condition] read wovf when wovf =1, then write 0 in wovf 1 tcnt overflow in watchdog timer mode 6 0 no internal reset when tcnt overflows (initial value) reset enable (rste) 1 internal reset when tcnt overflows note: the sh7050 chip is not reset internally, but tcnt and tcsr are reset in the watchdog timer.
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 794 of 818 rej09b0273-0500 standby control register (sbycr) h'ffff8614 8 power-down state bit:76543210 bit name: ssby hiz ?????? initial value:00011111 r/w:r/wr/wrrrrrr bit bit name value description 7 software standby (ssby) 0 transition to sleep mode on execution of sleep instruction (initial value) 1 transition to software standby mode on execution of sleep instruction 6 port high-impedance (hiz) 0 pin states retained in software standby mode (initial value) 1 pins set to high-impedance in software standby mode
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 795 of 818 rej09b0273-0500 bus control register 1 (bcr1) h'ffff8620 8/16/32 bsc bit: 15 14 13 12 11 10 9 8 bit name: ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 bit name: ???? a3sz a2sz a1sz a0sz initial value:00001111 r/w:rrrrr/wr/wr/wr/w bit bit name value description 3 0 cs3 space has byte (8-bit) bus size cs3 space size specification (a3sz) 1 cs3 space has word (16-bit) bus size (initial value) 2 0 cs2 space has byte (8-bit) bus size cs2 space size specification (a2sz) 1 cs2 space has word (16-bit) bus size (initial value) 1 0 cs1 space has byte (8-bit) bus size cs1 space size specification (a1sz) 1 cs1 space has word (16-bit) bus size (initial value) 0 0 cs0 space has byte (8-bit) bus size cs0 space size specification (a0sz) 1 cs0 space has word (16-bit) bus size (initial value) note: a0sz is valid only in on-chip rom enabled mode in on-chip rom disabled mode, the bus size for the cs0 space is set by the mode pins.
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 796 of 818 rej09b0273-0500 bus control register 2 (bcr2) h'ffff8622 8/16/32 bsc bit: 15 14 13 12 11 10 9 8 bit name: iw31 iw30 iw21 iw20 iw11 iw10 iw01 iw00 initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: cw3 cw2 cw1 cw0 sw3 sw2 sw1 sw0 initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 0 0 no cs3 space idle cycle 14 inter-cycle idle specification (iw31, iw30) 1 one cs3 space idle cycle 1 0 two cs3 space idle cycles 1 three cs3 space idle cycles (initial value) 13 0 0 no cs2 space idle cycle 12 inter-cycle idle specification (iw21, iw20) 1 one cs2 space idle cycle 1 0 two cs2 space idle cycles 1 three cs2 space idle cycles (initial value) 11 0 0 no cs1 space idle cycle 10 inter-cycle idle specification (iw11, iw10) 1 one cs1 space idle cycle 1 0 two cs1 space idle cycles 1 three cs1 space idle cycles (initial value) 9 0 0 no cs0 space idle cycle 8 inter-cycle idle specification (iw01, iw00) 1 one cs0 space idle cycle 1 0 two cs0 space idle cycles 1 three cs0 space idle cycles (initial value)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 797 of 818 rej09b0273-0500 bit bit name value description 7 0 no idle cycle in cs3 space access idle specification for continuous access (cw3) 1 one idle cycle in cs3 space access(initial value) 6 0 no idle cycle in cs2 space access idle specification for continuous access (cw2) 1 one idle cycle in cs2 space access(initial value) 5 0 no idle cycle in cs1 space access idle specification for continuous access (cw1) 1 one idle cycle in cs1 space access(initial value) 4 0 no idle cycle in cs0 space access idle specification for continuous access (cw0) 1 one idle cycle in cs0 space access(initial value) 3 0 no cs3 space cs assert extension cs assert extension specification (sw3) 1 cs3 space cs assert extension (initial value) 2 0 no cs2 space cs assert extension cs assert extension specification (sw2) 1 cs2 space cs assert extension (initial value) 1 0 no cs1 space cs assert extension cs assert extension specification (sw1) 1 cs1 space cs assert extension (initial value) 0 0 no cs0 space cs assert extension cs assert extension specification (sw0) 1 cs0 space cs assert extension (initial value)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 798 of 818 rej09b0273-0500 wait control register 1 (wcr1) h'ffff8624 8/16/32 bsc bit: 15 14 13 12 11 10 9 8 bit name: w33 w32 w31 w30 w23 w22 w21 w20 initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit:76543210 bit name: w13 w12 w11 w10 w03 w02 w01 w00 initial value:11111111 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit bit name value description 15 ? 12 cs3 space wait specification (w33, w32, w31, w30) 0 0 0 0 no wait, external wait input disabled 0 0 0 1 one wait, external wait input enabled 1111 15 waits, external wait input enabled (initial value) 11 ? 8 cs3 space wait specification (w23, w22, w21, w20) 0 0 0 0 no wait, external wait input disabled 0 0 0 1 one wait, external wait input enabled 1111 15 waits, external wait input enabled (initial value) 7 ? 4 cs3 space wait specification (w13, w12, w11, w10) 0 0 0 0 no wait, external wait input disabled 0 0 0 1 one wait, external wait input enabled 1111 15 waits, external wait input enabled (initial value) 3 ? 0 cs3 space wait specification (w03, w02, w01, w00) 0 0 0 0 no wait, external wait input disabled 0 0 0 1 one wait, external wait input enabled 1111 15 waits, external wait input enabled (initial value)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 799 of 818 rej09b0273-0500 wait control register 2 (wcr2) h'ffff8626 8/16/32 bsc bit: 15 14 13 12 11 10 9 8 bit name: ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 bit name: ???? dsw3 dsw2 dsw1 dsw0 initial value:00001111 r/w:rrrrr/wr/wr/wr/w bit bit name value description 3 ? 0 0 0 0 0 no wait, external wait input disabled 0 0 0 1 one wait, external wait input enabled to wait specification for cs space single address mode access (dsw3, dsw2, dsw1, dsw0) 1 1 1 1 15 waits, external wait input enabled (initial value)
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 800 of 818 rej09b0273-0500 ram emulation register (ramer) h'ffff8628 8/16/32 flash memory bit: 15 14 13 12 11 10 9 8 bit name: ???????? initial value:00000000 r/w:rrrrrrrr bit:76543210 bit name: ????? rams ram1 ram0 initial value:00000000 r/w:rrrrrr/wr/wr/w bit bit name value description 2 ram select (rams) 0 emulation not selected write/erase protection disabled for all flash memory blocks (initial value) 1 emulation selected write/erase protection enabled for all flash memory blocks 1, 0 ram area specification (ram1, ram0) selection of flash memory area overlapping ram ram area rams ram1 ram0 h'ffffe800 ? h'fff ebff 0 ** h'0001f000 ? h'0001f3ff 1 0 0 h'0001f400 ? h'0001f7ff 1 0 1 h'0001f800 ? h'0001fbff 1 1 0 h'0001fc00 ? h'0001ffff 1 1 1
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 801 of 818 rej09b0273-0500 dmac operation register (dmaor) h'ffff86b0 (all channels) 16 dmac bit: 15 14 13 12 11 10 9 8 bit name: ?????? pr1 pr0 initial value:00000000 r/w:rrrrrrr/wr/w bit:76543210 bit name: ????? ae nmif dme initial value:00000000 r/w:rrrrrrr/(w) * r/w note: * only 0 can be written in bits ae and nmif, after reading 1 from these bits. bit bit name value description 9, 8 priority mode 1 and 0 (pr1, pr0) 0 0 fixed priority order (ch0 > ch1 > ch2 > ch3) (initial value ) 1 fixed priority order (ch0 > ch2 > ch3 > ch1) 1 0 fixed priority order (ch2 > ch0 > ch1 > ch3) 1 round robin mode 2 address error flag (ae) 0 no address error, dma transfer enabled (initial value ) [clearing condition] read ae when ae =1, then write 0 in ae 1 address error present, dma transfer disabled [setting condition] address error due to dmac 1 nmi flag (nmif) 0 no nmi input, dma transfer enabled (initial value ) [clearing condition] read nmif when nmif =1, then write 0 in nmif 1 nmi input present, dma transfer disabled [setting condition] nmi interrupt generated 0 0 operation disabled on all channels (initial value ) dmac master enable (dme) 1 operation enabled on all channels
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 802 of 818 rej09b0273-0500 dma source address registers 0 to 3 h'ffff86c0 (channel 0) 16/32 dmac (sar0 to sar3) h'ffff86d0 (channel 1) 16/32 h'ffff86e0 (channel 2) 16/32 h'ffff86f0 (channel 3) 16/32 bit: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name: initial value: ???????????????? r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit:1514131211109876543210 bit name: initial value: ???????????????? r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 31 ? 0 (transfer source address specification) specifies dma transfer source address
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 803 of 818 rej09b0273-0500 h'ffff86c4 (channel 0) 16/32 dmac dma destination address registers 0 to 3 (dar0 to dar3) h'ffff86d4 (channel 1) 16/32 h'ffff86e4 (channel 2) 16/32 h'ffff86f4 (channel 3) 16/32 bit: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name: initial value: ???????????????? r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit:1514131211109876543210 bit name: initial value: ???????????????? r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 31 ? 0 (transfer destination address specification) specifies dma transfer destination address
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 804 of 818 rej09b0273-0500 h'ffff86c8 (channel 0) 32 dmac dma transfer count registers 0 to 3 (dmatcr0 to dmatcr3) h'ffff86d8 (channel 1) 32 h'ffff86e8 (channel 2) 32 h'ffff86f8 (channel 3) 32 bit: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name: ???????? initial value:00000000 ???????? r/w:rrrrrrrrr/wr/wr/wr/wr/wr/wr/wr/w bit:1514131211109876543210 bit name: initial value: ???????????????? r/w: r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w r/w bit bit name description 23 ? 0 (dma transfer count specification) specifies the number of dma transfers (number of bytes, words, or longwords) during dmac operation, indicates the remaining number of transfers
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 805 of 818 rej09b0273-0500 h'ffff86cc (channel 0) 16/32 dmac dma channel control registers 0 to 3 (chcr0 to chcr3) h'ffff86dc (channel 1) 16/32 h'ffff86ec (channel 2) 16/32 h'ffff86fc (channel 3) 16/32 bit: 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 bit name: ??????????? di ro rl am al initial value:0000000000000000 r/w:rrrrrrrrrrrr/wr/wr/wr/wr/w bit:1514131211109876543210 bit name: dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 ? ds tm ts1 ts0 ie te de initial value:0000000000000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w r r/w r/w r/w r/w r/w r/(w) r/w notes: 1. only 0 can be written in the te bit, after reading 1 from this bit. 2. the di, ro, rl, am, al, or ds bit may be absent, depending on the channel. bit bit name value description 20 0 channel 3 operates in direct address mode (initial value) direct/indirect select (di) 1 channel 3 operates in indirect address mode 19 source address reload (ro) 0 source address not reloaded (initial value) 1 source address reloaded 18 0 active-high drak output (initial value) request check level (rl) 1 active-low drak output 17 0 dack output in read cycle (initial value) acknowledge mode (am) 1 dack output in write cycle 16 0 active-high output (initial value) acknowledge level (al) 1 active-low output 15, 14 0 0 destination address fixed (initial value) destination address mode 1 and 0 (dm1, dm0) 1 destination address incremented (+1 for 8-bit transfer, +2 for 16-bit transfer, +4 for 32-bit transfer) 1 0 destination address decremented ( ? 1 for 8-bit transfer, ? 2 for 16-bit transfer, ? 4 for 32-bit transfer) 1 setting prohibited
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 806 of 818 rej09b0273-0500 bit bit name value description 13, 12 0 0 source address fixed (initial value) source address mode 1 and 0 (sm1, sm0) 1 source address incremented (+1 for 8-bit transfer, +2 for 16-bit transfer, +4 for 32-bit transfer) 1 0 source address decremented ( ? 1 for 8-bit transfer, ? 2 for 16-bit transfer, ? 4 for 32-bit transfer) 1 setting prohibited 11 ? 8 0000external request, dual address mode (initial value) resource select 3, 2, 1, and 0 (rs3, rs2, rs1, rs0) 1 setting prohibited 1 0 external request, single address mode external address space to external device 1 external request, single address mode external device to external address space 100auto-request 1 setting prohibited 1 0 atu, compare match 6 (cmi6) 1 atu, input capture 0b (ici0b) 1000sci0 transmission 1 sci0 reception 1 0 sci1 transmission 1 sci1 reception 100sci2 transmission 1 sci2 reception 1 0 on-chip a/d0 1 on-chip a/d1 6 dreq select (ds) 0 low level detection (initial value) 1 falling edge detection 5 transmit mode (tm) 0 cycle steal mode 1 burst mode 4, 3 0 0 byte size (8 bits) (initial value) transmit size 1 and 0 (ts1, ts0) 1 word size (16 bits) 1 0 longword size (32 bits) 1 setting prohibited 2 interrupt enable (ie) 0 no interrupt request generated at end of number of transfers specified in dmatcr (initial value) 1 interrupt request generated at end of number of transfers specified in dmatcr
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 807 of 818 rej09b0273-0500 bit bit name value description 1 transfer end (te) 0 number of transfers specified in dmatcr not completed(initial value) [clearing conditions] read te when te =1, then write 0 in te power-on reset or transition to standby mode 1 number of transfers specified in dmatcr completed 0 dmac enable (de) 0 operation on corresponding channel disabled (initial value) 1 operation on corresponding channel enabled
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 808 of 818 rej09b0273-0500 a.3 register states at reset and in power-down state reset power-down state type registers (abbreviations) power- on hardware standby software standby sleep cpu r0 ? r15 initialized initialized held held sr gbr vbr mach, macl pr pc ipra ? iprh initialized initialized held held interrupt controller (intc) icr isr ubarh, ubarl initialized initialized held held user break controller (ubc) ubamrh, ubamrl ubbr bcr1, bcr2 initialized initialized held held bus state controller (bsc) wcr1, wcr2 sar0 ? sar3 initialized initialized initialized held dar0 ? dar3 direct memory access controller (dmac) dmatcr0 ? dmatcr3 chcr0 ? chcr3 dmaor
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 809 of 818 rej09b0273-0500 reset power-down state type registers (abbreviations) power- on hardware standby software standby sleep pscr1 initialized initialized initialized held advanced timer unit (atu) tstr tgsr tior0a, tior1a ? tior1c, tior2a, tior3a, tior3b, tior4a, tior4b, tior5a itvrr tsrah, tsral, tsrb, tsrc, tsrdh, tsrdl, tsre, tsrf tiera, tierb, tierc tierdh, tierdl, tiere, tierf tcnt0h, tcnt0l, tcnt1 ? tcnt9 icr0ah,l ? icr0dh,l tcr1 ? tcr10 gr1a ? gr1f, gr2a, gr2b, gr3a ? gr3d, gr4a ? gr4d, gr5a, gr5b osbr tmdr cylr6 ? cylr9 bfr6 ? bfr9 dtr6 ? dtr9 tcnr dstr dcnt10a ? dcnt10h
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 810 of 818 rej09b0273-0500 reset power-down state type registers (abbreviations) power- on hardware standby software standby sleep advanced pulse controller (apc) popcr initialized initialized held held tcnt initialized initialized initialized held watchdog timer (wdt) tcsr * rstcsr initialized smr0 ? smr2 initialized initialized initialized held serial communication interface (sci) brr0 ? brr2 scr0 ? scr2 tdr0 ? tdr2 ssr0 ? ssr2 rdr0 ? rdr2 a/d converter addr0(h/l) ? addr15(h/l) initialized initialized initialized held adcsr0, adcsr1 adcr0, adcr1 adtrgr cmstr initialized initialized initialized held compare match timer (cmt) cmcsr0, cmcsr1 cmcnt0, cmcnt1 cmcor0, cmcor1 pin function controller (pfc) paior, pbior, pcior, pdior, peior, pfior, pgior initialized initialized held held pacr, pbcr, pccr1, pccr2, pdcr, pecr, pfcr1, pfcr2, pgcr1, pgcr2
appendix a on-chip supporting module registers rev. 5.00 jan 06, 2006 page 811 of 818 rej09b0273-0500 reset power-down state type registers (abbreviations) power- on hardware standby software standby sleep i/o ports padr, pbdr, pcdr, pddr, pedr, pfdr, pgdr, phdr initialized initialized held held flash rom flmcr1 initialized initialized initialized held flmcr2 held ebr1 initialized ramer held sbycr initialized initialized held held power-down state related syscr note: * bits 7 to 5 (ovf, wt/ it , and tme) are initialized, and bits 2 to 0 (cks2 to cks0) are held.
appendix b pin states rev. 5.00 jan 06, 2006 page 812 of 818 rej09b0273-0500 appendix b pin states b.1 pin states at reset and in power-down, and bus right released state table b.1 shows the sh7050 pin states at reset and in power-down, and bus right released state. table b.1 pin states at reset and in power-down, and bus right released state pin function pin state reset power-down power-on reset by res res res res pin item pins romless, expanded, 8-bit romless, expanded, 16-bit expanded, with rom single- chip hardware standby software standby sleep bus- released state extal i i i i z z i i xtal o o o o z z o o clock ck oooozh * oo fwe, md0?md3 iiiiiiii operating mode selection hstby iiiiiiii res iiiiiiii wdtovf oooozh * oo breq ????zzii system control back ????zzoo nmi iiiiiiii irq0 ? irq7 ????zzii interrupt irqout ????zh * oo address bus a0?a21 l l ? ? z z o z d0?d7 z z ? ? z z i/o z data bus d8?d15 ? z ? ? z z i/o z
appendix b pin states rev. 5.00 jan 06, 2006 page 813 of 818 rej09b0273-0500 pin function pin state reset power-down power-on reset by res res res res pin item pins romless, expanded, 8-bit romless, expanded, 16-bit expanded, with rom single- chip hardware standby software standby sleep bus- released state cs0 hhh?zzoz cs1 ? cs3 ????zzoz rd hhh?zzoz wrh , wrl hhh?zzoz bus control wait iii?zziz dreq0 , dreq1 ????zzii drak0, drak1 ????zo * oo direct memory access controller (dmac) dack0, dack1 ????zo * oo tclka, tclkb ????zzii tia0?tid0 ? ? ? ? z z i i tioa1? tiof1 ????zk * i/o i/o tioa2, tiob2 ????zk * i/o i/o tioa3? tiod3 ????zk * i/o i/o tioa4? tiod4 ????zk * i/o i/o tioa5, tiob5 ????zk * i/o i/o to6?to9 ? ? ? ? z o * oo advanced timer unit (atu) toa10? toh10 ????zo * oo advanced pulse controller (apc) puls0? puls7 ????zo * oo
appendix b pin states rev. 5.00 jan 06, 2006 page 814 of 818 rej09b0273-0500 pin function pin state reset power-down power-on reset by res res res res pin item pins romless, expanded, 8-bit romless, expanded, 16-bit expanded, with rom single- chip hardware standby software standby sleep bus- released state txd0? txd2 ????zo * oo rxd0? rxd2 ????zzii serial communi- cation interface (sci) sck0? sck2 ????zk * i/o i/o an0?an15 z z z z z z i i adtrg ????zzii a/d converter adend ? ? ? ? z o * oo pod ????zzii pa0?pa15 ? ? z z z k * i/o i/o pb0?pb5 z z z z z k * i/o i/o pb6?pb11 ? ? z z z k * i/o i/o pc0?pc4 ? ? ? z z k * i/o i/o pc5?pc14 z z z z z k * i/o i/o pd0?pd7 ? ? z z z k * i/o i/o pd8?pd15 z ? z z z k * i/o i/o pe0?pe14 z z z z z k * i/o i/o pf0?pf11 z z z z z k * i/o i/o pg0?pg15 z z z z z k * i/o i/o i/o port ph0?ph15 z z z z z z i i i: input o: output h: high-level output l: low-level output z: high-impedance k: input pins are in the high-impedance state; output pins maintain their previous state. note: * when the hiz bit of the standby control register (sbycr) is set to 1, output pins are in high impedance state.
appendix b pin states rev. 5.00 jan 06, 2006 page 815 of 818 rej09b0273-0500 b.2 pin states of bus related signals table b.2 shows the sh7050 pin states of bus related signals. table b.2 pin states of bus related signals on-chip peripheral module 16-bit space pins on-chip rom on-chip ram 8-bit space upper byte lower byte word/ long word cs0 to cs3 hhhhhh rhhhhhh rd w?hhhhh rhhhhhh wrh w?hhhhh rhhhhhh wrl w?hhhhh a21 to a0 address address address address address address d15 to d8 hi-z hi-z hi-z hi-z hi-z hi-z d7 to d0 hi-z hi-z hi-z hi-z hi-z hi-z external common space pins 8-bit space upper byte lower byte word/long word cs0 to cs3 valid valid valid valid rllll rd whhhh rhhhh wrh wh l h l rhhhh wrl wl h l l a21 to a0 address address address address d15 to d8 hi-z data hi-z data d7 to d0 data hi-z data data note: r is reading operation. w is writing operation.
appendix c product code lineup rev. 5.00 jan 06, 2006 page 816 of 818 rej09b0273-0500 appendix c product code lineup table c.1 shows sh7050 series product code lineup. table c.1 sh7050 series product code lineup product type product code mark code package sh7050 mask rom hd6437050f20 hd6437050( *** )f20 flash memory hd64f7050sf20 hd64f7050sf20 168 pin plastic qfp (prqp0168ja-a) sh7051 flash memory hd64f7051sf20 hd64f7051sf20 note: for mask rom versions, ( *** ) is the rom code.
appendix d package dimensions rev. 5.00 jan 06, 2006 page 817 of 818 rej09b0273-0500 appendix d package dimensions figure d.1 shows the sh7050 series package dimensions (prqp0168ja-a). note) 1. dimensions" * 1"and" * 2" do not include mold flash 2. dimension" * 3"does not include trim offset. p e d e d ym x f 43 142 168 127 126 85 84 * 1 * 2 * 3 z z e h h b d 2 1 1 detail f c l a a l a 1 1 p terminal cross section b c c b l 1 z e z d y x c b 1 b p a h d a 2 e d a 1 c 1 e e l h e 0.68 28 1.6 0.10 0 8 0.65 0.12 0.17 0.22 0.24 0.32 0.40 0.00 0.15 0.25 3.56 30.9 31.2 31.5 3.20 28 0.30 0.15 0.5 0.8 1.1 0.68 0.13 31.5 31.2 30.9 reference symbol dimension in millimeters min nom max p-qfp168-28x28-0.65 5.3g mass[typ.] fp-168/fp-168v prqp0168ja-a renesas code jeita package code previous code figure d.1 package dimensions
appendix d package dimensions rev. 5.00 jan 06, 2006 page 818 of 818 rej09b0273-0500
renesas 32-bit risc microcomputer hardware manual sh7050 group, SH7050F-ZTAT ? ? ? ? , sh7051f-ztat ? ? ? ? publication date: 1st edition, march 1997 rev.5.00, january 06, 2006 published by: sales strategic planning div. renesas technology corp. edited by: customer support department global strategic communication div. renesas solutions corp. ?2006. renesas technology corp., all rights reserved. printed in japan.
sales strategic planning div. nippon bldg., 2-6-2, ohte-machi, chiyoda-ku, tokyo 100-0004, japan http://www.renesas.com refer to " http://www.renesas.com/en/network " for the latest and detailed information. renesas technology america, inc. 450 holger way, san jose, ca 95134-1368, u.s.a tel: <1> (408) 382-7500, fax: <1> (408) 382-7501 renesas technology europe limited dukes meadow, millboard road, bourne end, buckinghamshire, sl8 5fh, u.k. tel: <44> (1628) 585-100, fax: <44> (1628) 585-900 renesas technology (shanghai) co., ltd. unit 205, azia center, no.133 yincheng rd (n), pudong district, shanghai 200120, china tel: <86> (21) 5877-1818, fax: <86> (21) 6887-7898 renesas technology hong kong ltd. 7th floor, north tower, world finance centre, harbour city, 1 canton road, tsimshatsui, kowloon, hong kong tel: <852> 2265-6688, fax: <852> 2730-6071 renesas technology taiwan co., ltd. 10th floor, no.99, fushing north road, taipei, taiwan tel: <886> (2) 2715-2888, fax: <886> (2) 2713-2999 renesas technology singapore pte. ltd. 1 harbour front avenue, #06-10, keppel bay tower, singapore 098632 tel: <65> 6213-0200, fax: <65> 6278-8001 renesas technology korea co., ltd. kukje center bldg. 18th fl., 191, 2-ka, hangang-ro, yongsan-ku, seoul 140-702, korea tel: <82> (2) 796-3115, fax: <82> (2) 796-2145 renesas technology malaysia sdn. bhd unit 906, block b, menara amcorp, amcorp trade centre, no.18, jalan persiaran barat, 46050 petaling jaya, selangor darul ehsan, malaysia tel: <603> 7955-9390, fax: <603> 7955-9510 renesas sales offices colophon 5.0
sh7050 group, SH7050F-ZTAT ? ? hardware manual


▲Up To Search▲   

 
Price & Availability of SH7050F-ZTAT

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X